Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 [Bug-Fix] add original timeout middleware #2367

Merged

Conversation

hakankutluay
Copy link
Contributor

Description

Middleware that was added on #2090, is renamed as timeout.NewWithContextto not break the original timeout middleware.

Fixes #2364

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • For new functionalities I follow the inspiration of the express js framework and built them similar in usage
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation - /docs/ directory for https://docs.gofiber.io/
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • If new dependencies exist, I have checked that they are really necessary and agreed with the maintainers/community (we want to have as few dependencies as possible)
  • I tried to make my code as fast as possible with as few allocations as possible

@hakankutluay
Copy link
Contributor Author

Sad but that will introduce a breaking change who uses timeout middleware after v2.38.1

@ReneWerner87
Copy link
Member

#2364 (comment)

@ReneWerner87
Copy link
Member

@hakankutluay thx for the last commit, can you also add some hint in the documentation pages
https://github.com/gofiber/fiber/blob/master/docs/api/middleware/timeout.md

@hakankutluay
Copy link
Contributor Author

@ReneWerner87, timeout.mdfile has been updated.

@gaby
Copy link
Member

gaby commented Mar 24, 2023

@hakankutluay Can you fix the conflicts with the MD file

@hakankutluay
Copy link
Contributor Author

@gaby sure, done!

@ReneWerner87
Copy link
Member

ReneWerner87 commented Apr 4, 2023

currently do not know what to do with the pull request
because of the comment
#2364 (comment)
the opinion is correct

we should definitely provide a more stable version, just because of the limitation in fasthttp i guess it will take a few more releases
(we also have to put our questions and requirements in the fasthttp repository)

now the question if the current customization should merge or not:
feel free to send a "thumbs up 👍" or "thumbs down 👎" to this comment (@gaby , @efectn , @leonklingele , @hakankutluay, @gofiber/contributors )

also feel free to share further comments

@hakankutluay
Copy link
Contributor Author

hakankutluay commented Apr 4, 2023

@ReneWerner87 I support having middleware that supports context timeout as another middleware by merging this commit.

I still defend having context cancelation (the new timeout middleware) has much more valid use cases on production than supporting just time.Sleep usage. Also we have still workaround for time.Sleep usage.

After this merge, we could try to fix the original timeout middleware's race condition problem.

But my concern is this

Sad but that will introduce a breaking change who uses timeout middleware after [v2.38.1]

@ReneWerner87
Copy link
Member

we will simply draw attention to it in the release notes
those who had not noticed, now have the old behavior

the others who switched to the context usage have our release notes in mind and should see that too

we can not fulfill both requirements at the same time, this undo is for me more like a bugfix for the old behavior

@gaby
Copy link
Member

gaby commented Apr 4, 2023

@ReneWerner87 @hakankutluay Agree with both statements. The sooner the change happens the better.

@ReneWerner87 ReneWerner87 merged commit 22b407e into gofiber:master Apr 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🤗 [Question]: Timeout is not work in Fiber v2.42.0
3 participants