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

Fix Ordering of UDP pending timeouts #3434

Merged
merged 2 commits into from
May 16, 2024
Merged

Fix Ordering of UDP pending timeouts #3434

merged 2 commits into from
May 16, 2024

Conversation

zkerriga
Copy link

Current Ordering.by[Timeout, Long](_.expiry) in AsynchronousSocketGroup is built the way so pendingTimeouts: PriorityQueue[Timeout] returns not the closest timeout that can be expired, but the furthest one during .headOption calls in selectorThread. Which, when read/write is called frequently, causes the selectorThread at each iteration to check for a timeout that was just added and does not need to be removed from the queue, causing a memory leak due to the infinite growth of pendingTimeouts.

I have checked locally that when using reverse, pendingTimeouts.headOption returns a timeout with the closest expiry time.

Unfortunately, I couldn't figure out a test for it

@zkerriga
Copy link
Author

I'm new here, the pipeline issues are not obvious to me. @mpilquist, could you please help and also review?

@armanbilge
Copy link
Member

armanbilge commented May 15, 2024

My guess is that CI is failing because it's silently updated to a newer version of Node.js than is supported by the old Scala.js in the build. We should open a separate PR to try and update the build / CI to be operational again.

@mpilquist mpilquist merged commit 8fe0b59 into typelevel:series/2.5.x May 16, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants