Skip to content

Conversation

majocha
Copy link
Contributor

@majocha majocha commented Oct 24, 2024

Fixes #17849

pulse disposal is under syncRoot lock now. Nullifying it ensures there is no attempt to set the disposed wait handle.

The overall result is that Post on disposed mailbox does not throw unless the mailbox was created with isThrowExceptionAfterDisposed = true. (See #13036)

The issue has minimal impact as certain rare conditions must be fulfilled to trigger the bug (#17849 (comment)).
This fix does not change the general behavior which is that a disposed mailbox should stop processing messages and (I presume) should not throw unless isThrowExceptionAfterDisposed is set.

@majocha majocha requested a review from a team as a code owner October 24, 2024 20:18
Copy link
Contributor

github-actions bot commented Oct 24, 2024

❗ Release notes required


✅ Found changes and release notes in following paths:

Change path Release notes path Description
src/FSharp.Core docs/release-notes/.FSharp.Core/9.0.200.md

@psfinaki
Copy link
Contributor

Do I get it right that this fixes this bug? If so, I guess the minimal repro your have there can serve as a test?

Copy link
Contributor

@psfinaki psfinaki left a comment

Choose a reason for hiding this comment

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

Thanks a lot!

@psfinaki psfinaki merged commit 6a933f6 into dotnet:main Oct 30, 2024
32 checks passed
@majocha majocha deleted the mailbox-disposed branch October 30, 2024 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Internal exception surfacing when calling Post on disposed MailBoxProcessor
3 participants