Skip to content

[EventEngine] Fix busy loop in thread pool when shutting down#39258

Closed
drfloob wants to merge 1 commit intogrpc:masterfrom
drfloob:rm-busy-loop-in-wstp
Closed

[EventEngine] Fix busy loop in thread pool when shutting down#39258
drfloob wants to merge 1 commit intogrpc:masterfrom
drfloob:rm-busy-loop-in-wstp

Conversation

@drfloob
Copy link
Copy Markdown
Member

@drfloob drfloob commented Apr 15, 2025

Potential alternative fix for #39240.

When the WorkStealingThreadPool is shutting down, the lifeguard thread could end up in a busy loop while waiting for the pool to quiesce. In some environments, this may prevent other threads from running in a timely manner, which can cause the process to hang. This PR adds a short delay on lifeguard thread's quiesce check, which grows exponentially to a maximum of 1 second if the thread pool is idle.

@drfloob drfloob added release notes: yes Indicates if PR needs to be in release notes and removed release notes: no Indicates if PR should not be in release notes labels Apr 17, 2025
drfloob added a commit that referenced this pull request Apr 17, 2025
…tting down (#39258) (#39296)

Backports #39258 to v1.72.x branch.

----

Potential alternative fix for #39240.

When the WorkStealingThreadPool is shutting down, the lifeguard thread
could end up in a busy loop while waiting for the pool to quiesce. In
some environments, this may prevent other threads from running in a
timely manner, which can cause the process to hang. This PR adds a short
delay on lifeguard thread's quiesce check, which grows exponentially to
a maximum of 1 second if the thread pool is idle.
gnossen pushed a commit that referenced this pull request Apr 21, 2025
…tting down (#39258) (#39319)

Backports #39258 to v1.68.x branch.

----

Potential alternative fix for #39240.

When the WorkStealingThreadPool is shutting down, the lifeguard thread
could end up in a busy loop while waiting for the pool to quiesce. In
some environments, this may prevent other threads from running in a
timely manner, which can cause the process to hang. This PR adds a short
delay on lifeguard thread's quiesce check, which grows exponentially to
a maximum of 1 second if the thread pool is idle.
drfloob added a commit that referenced this pull request Apr 21, 2025
…tting down (#39258) (#39315)

Backports #39258 to v1.71.x branch.

----

Potential alternative fix for #39240.

When the WorkStealingThreadPool is shutting down, the lifeguard thread
could end up in a busy loop while waiting for the pool to quiesce. In
some environments, this may prevent other threads from running in a
timely manner, which can cause the process to hang. This PR adds a short
delay on lifeguard thread's quiesce check, which grows exponentially to
a maximum of 1 second if the thread pool is idle.
veblush pushed a commit that referenced this pull request Apr 21, 2025
…tting down (#39258) (#39318)

Backports #39258 to v1.69.x branch.

----

Potential alternative fix for #39240.

When the WorkStealingThreadPool is shutting down, the lifeguard thread
could end up in a busy loop while waiting for the pool to quiesce. In
some environments, this may prevent other threads from running in a
timely manner, which can cause the process to hang. This PR adds a short
delay on lifeguard thread's quiesce check, which grows exponentially to
a maximum of 1 second if the thread pool is idle.
yashykt pushed a commit that referenced this pull request Apr 22, 2025
…utting down (#39258) (#39320)

Backports #39258 to v1.67.x branch.

----

Potential alternative fix for #39240.

When the WorkStealingThreadPool is shutting down, the lifeguard thread
could end up in a busy loop while waiting for the pool to quiesce. In
some environments, this may prevent other threads from running in a
timely manner, which can cause the process to hang. This PR adds a short
delay on lifeguard thread's quiesce check, which grows exponentially to
a maximum of 1 second if the thread pool is idle.
yashykt pushed a commit that referenced this pull request Apr 30, 2025
…utting down (#39258) (#39317)

Backports #39258 to v1.70.x branch.

----

Potential alternative fix for #39240.

When the WorkStealingThreadPool is shutting down, the lifeguard thread
could end up in a busy loop while waiting for the pool to quiesce. In
some environments, this may prevent other threads from running in a
timely manner, which can cause the process to hang. This PR adds a short
delay on lifeguard thread's quiesce check, which grows exponentially to
a maximum of 1 second if the thread pool is idle.
This was referenced May 5, 2025
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.

2 participants