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

KTOR-8045 Fix for NPE race condition in dispose #4597

Merged
merged 2 commits into from
Jan 14, 2025
Merged

Conversation

bjhham
Copy link
Contributor

@bjhham bjhham commented Jan 13, 2025

Subsystem
Server, DoubleReceive

Motivation
KTOR-8045 DoubleReceive: NullPointerException caused by race condition

Solution
Moving the body's discard call outside the coroutine avoids the race condition when dispose is called twice.

@bjhham bjhham requested a review from osipxd January 14, 2025 09:26
Copy link
Member

@osipxd osipxd left a comment

Choose a reason for hiding this comment

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

LGTM! 🏆

@bjhham bjhham enabled auto-merge (rebase) January 14, 2025 14:02
@osipxd osipxd force-pushed the bjhham/npe-double-receive branch from ade4a8a to a59f7c3 Compare January 14, 2025 15:05
@osipxd osipxd disabled auto-merge January 14, 2025 15:06
@osipxd osipxd enabled auto-merge (squash) January 14, 2025 15:06
@osipxd osipxd merged commit 14e92ae into main Jan 14, 2025
15 of 16 checks passed
@osipxd osipxd deleted the bjhham/npe-double-receive branch January 14, 2025 15:53
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