Skip to content

Conversation

GrizzlT
Copy link
Contributor

@GrizzlT GrizzlT commented Aug 25, 2021

I found out the reactor transport was bugged due to a mistake in concurrency. Since I'm the author of this particular part of the code I assume I should fix it as well. I have refactored the code using the java.util.concurrent.locks package into safer code while fixing said bug. Fixes #461

- Refactored `ReactorHttpClient` to use `ReentrantLock`
- Fixed a racing condition bug that can lead to unexpected behaviour and following "death" of the reactor transport
@GrizzlT GrizzlT marked this pull request as draft August 26, 2021 14:07
@GrizzlT GrizzlT marked this pull request as ready for review August 26, 2021 15:58
@GrizzlT
Copy link
Contributor Author

GrizzlT commented Aug 26, 2021

The actual bug leading to this pull request seems to have been the wrong type of thread used to run the main loop on, after 60 seconds of idling, it automatically gets terminated. This also includes blocking threads. I changed this into using a single thread that only terminates when we explicitly tell it to.

@GrizzlT GrizzlT changed the title Bugfix - On very rare occasions, the reactor transport stops working Critical Bugfix - Sometimes, the reactor transport stops working Aug 26, 2021
@ConnorLinfoot ConnorLinfoot merged commit c3bc669 into HypixelDev:master Sep 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Reactor transport stops working after a while
2 participants