Skip to content

Stop searching for work when stolen timers filled the local queue - #4688

Open
ichraf7 wants to merge 1 commit into
typelevel:series/3.xfrom
ichraf7:fix/searching-worker-nonempty-queue
Open

ichraf7 wants to merge 1 commit into
typelevel:series/3.xfrom
ichraf7:fix/searching-worker-nonempty-queue

Conversation

@ichraf7

@ichraf7 ichraf7 commented Sep 20, 2026

Copy link
Copy Markdown

Add a check that prevent searcher thread from stealling from other thread or from external queue when it queue is no longer empty. The current behavior cause a forver spin of searcher thread when expiring timer fill all the local queue

issue discussed here #issues/4674

Add a check that prevent searcher thread from stealling from other thread
or from external queue when it queue is no longer empty.
The current behavior cause a forver spin of searcher thread when expiring timer fill all the local queue

issue discussed here #issues/4674
@reardonj

Copy link
Copy Markdown
Contributor

@armanbilge , @djspiewak , looks like we have the answer to this question!

We should probably steal both timers and fibers; why only steal one?
-- #4247 (comment)

@reardonj reardonj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense to me.

// First try to steal some expired timers.
val stoleTimers = pool.stealTimers(now, rnd)

// Stolen timer callbacks resume fibers, and resumed fibers are

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do stolen timer callbacks always resume fibers? Wondering if we could just check stoleTimers instead of queue.nonEmpty()

This branch has not been deployed

No deployments
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.

2 participants