Skip to content

[EventEngine] Fix a Windows race that causes an assertion error#41563

Closed
murgatroid99 wants to merge 4 commits into
grpc:masterfrom
murgatroid99:windows_engine_race_fix
Closed

[EventEngine] Fix a Windows race that causes an assertion error#41563
murgatroid99 wants to merge 4 commits into
grpc:masterfrom
murgatroid99:windows_engine_race_fix

Conversation

@murgatroid99

Copy link
Copy Markdown
Member

This should fix #40405 by fixing the race described in #40405 (comment).

@murgatroid99 murgatroid99 added lang/core release notes: yes Indicates if PR needs to be in release notes labels Feb 4, 2026
asheshvidyut pushed a commit to asheshvidyut/grpc that referenced this pull request Apr 8, 2026
…#41563)

This should fix grpc#40405 by fixing the race described in grpc#40405 (comment).

<!--

If you know who should review your pull request, please assign it to that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the appropriate
lang label.

-->

Closes grpc#41563

COPYBARA_INTEGRATE_REVIEW=grpc#41563 from murgatroid99:windows_engine_race_fix d8415d0
PiperOrigin-RevId: 891768950
copybara-service Bot pushed a commit that referenced this pull request May 5, 2026
This issue was introduced by #41563. That PR allowed `OnConnectCompleted` to proceed past a failed `Cancel(state->timer_handle())`, and the next line releases the timer callback. That is a problem because the timer callback can still run, though it won't actually do anything beyond see that the `OnConnectedCallback` ran and then release itself. The solution is to only release the timer callback if the timer was successfully cancelled, and otherwise count on the timer callback to clean itself up.

`OnConnectCallback` doesn't interact with the timer after that point, so I'm fairly certain that this is the last problem of its kind here.

<!--

If you know who should review your pull request, please assign it to that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the appropriate
lang label.

-->

Closes #42078

COPYBARA_INTEGRATE_REVIEW=#42078 from murgatroid99:windows_event_engine_race_fix_2 ec74a2e
PiperOrigin-RevId: 910905066
asheshvidyut pushed a commit to a-detiste/grpc that referenced this pull request Jun 10, 2026
…#41563)

This should fix grpc#40405 by fixing the race described in grpc#40405 (comment).

<!--

If you know who should review your pull request, please assign it to that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the appropriate
lang label.

-->

Closes grpc#41563

COPYBARA_INTEGRATE_REVIEW=grpc#41563 from murgatroid99:windows_engine_race_fix d8415d0
PiperOrigin-RevId: 891768950
asheshvidyut pushed a commit to a-detiste/grpc that referenced this pull request Jun 10, 2026
…2078)

This issue was introduced by grpc#41563. That PR allowed `OnConnectCompleted` to proceed past a failed `Cancel(state->timer_handle())`, and the next line releases the timer callback. That is a problem because the timer callback can still run, though it won't actually do anything beyond see that the `OnConnectedCallback` ran and then release itself. The solution is to only release the timer callback if the timer was successfully cancelled, and otherwise count on the timer callback to clean itself up.

`OnConnectCallback` doesn't interact with the timer after that point, so I'm fairly certain that this is the last problem of its kind here.

<!--

If you know who should review your pull request, please assign it to that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the appropriate
lang label.

-->

Closes grpc#42078

COPYBARA_INTEGRATE_REVIEW=grpc#42078 from murgatroid99:windows_event_engine_race_fix_2 ec74a2e
PiperOrigin-RevId: 910905066
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bloat/none lang/core release notes: yes Indicates if PR needs to be in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

grpc_event_engine::experimental::WinSocke triggered an abort during destruction.

2 participants