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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 fix: deadlock on session #1248

Merged
merged 1 commit into from
Mar 30, 2021
Merged

馃悰 fix: deadlock on session #1248

merged 1 commit into from
Mar 30, 2021

Conversation

si3nloong
Copy link
Contributor

@si3nloong si3nloong commented Mar 30, 2021

Please provide enough information so that others can review your pull request:
The mutex lock never unlock if the subsequent code return error

Explain the details for making this change. What existing problem does the pull request solve?
This PR mainly to fix deadlock and prevent memory leak issue on acquireCookie, allow cookie to release back to pool if cookie.ParseBytes return error

@ReneWerner87
Copy link
Member

Thanks for the fix.

@ReneWerner87
Copy link
Member

We had then tried everywhere to get the maximum performance out, since the use of defer is a bit slower, that probably would not be used here and over time the code has grown, creating several cases that are of course not covered, here we should use the defer method

because the readability and the error vulnerability is then no longer in the right proportion to the performance gain.
Thx

@ReneWerner87 ReneWerner87 merged commit c71da35 into gofiber:master Mar 30, 2021
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.

None yet

2 participants