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 nil pointer dereference when consuming events #48

Merged
merged 2 commits into from
Dec 14, 2023

Conversation

impl
Copy link
Contributor

@impl impl commented Dec 13, 2023

If an event is received after the internal timer waiting for it has elapsed, it should be placed into the pending events queue to be handled by the next WaitForSingleEvent invocation. However, the internal timer expiration callback does not reset the pending task list correctly, causing the event consumer to attempt to dereference an element of an empty list.

This change adjusts the logic of the timer to completely eradicate the list from the pending event key map when it's empty, which matches the behavior of other orchestrator cleanup routines.

If an event is received after the internal timer waiting for it has
elapsed, it should be placed into the pending events queue to be handled
by the next WaitForSingleEvent invocation. However, the internal timer
expiration callback does not reset the pending task list correctly,
causing the event consumer to attempt to dereference an element of an
empty list.

This change adjusts the logic of the timer to completely eradicate the
list from the pending event key map when it's empty, which matches the
behavior of other orchestrator cleanup routines.
@impl
Copy link
Contributor Author

impl commented Dec 13, 2023

@microsoft-github-policy-service agree

Copy link
Member

@cgillum cgillum left a comment

Choose a reason for hiding this comment

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

Thanks @impl for this PR contribution! The change looks good to me.

@cgillum cgillum merged commit aa335e2 into microsoft:main Dec 14, 2023
4 checks passed
@impl impl deleted the fix-pending-task-cleanup-after-timeout branch December 14, 2023 07:49
@kaibocai kaibocai mentioned this pull request Dec 18, 2023
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