Skip to content

Conversation

rstm-sf
Copy link
Contributor

@rstm-sf rstm-sf commented Apr 23, 2022

Fixed #10720

Is it worth worrying about it?

member _.inbox =
match inboxStore with
| null -> inboxStore <- new System.Collections.Generic.List<'Msg>(1)
| _ -> ()
inboxStore

@rstm-sf rstm-sf marked this pull request as draft April 23, 2022 10:47
@rstm-sf
Copy link
Contributor Author

rstm-sf commented Apr 25, 2022

@rstm-sf rstm-sf marked this pull request as ready for review August 31, 2023 19:05
@rstm-sf rstm-sf requested a review from a team as a code owner August 31, 2023 19:05
@rstm-sf
Copy link
Contributor Author

rstm-sf commented Sep 1, 2023

Sorry I don't understand this error https://dev.azure.com/dnceng-public/public/_build/results?buildId=392941&view=logs&j=882ba401-d5d6-57d5-a958-980a439dbeb8&t=03421b2c-e47d-52ac-cb71-f3db07decb69&l=3480

Failed FSharp.Editor.IntegrationTests.CodeActionTests.UnusedOpenDeclarations (VS2022) [5 s]
  Error Message:
   System.Threading.Tasks.TaskCanceledException : A task was canceled.
  Stack Trace:
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at FSharp.Editor.IntegrationTests.Helpers.LightBulbHelper.<WaitForItemsAsync>d__0.MoveNext() in /_/vsintegration/tests/FSharp.Editor.IntegrationTests/Helpers/LightBulbHelper.cs:line 63
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Extensibility.Testing.EditorInProcess.<InvokeCodeActionListAsync>d__4.MoveNext() in /_/vsintegration/tests/FSharp.Editor.IntegrationTests/InProcess/EditorInProcess.cs:line 91
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at FSharp.Editor.IntegrationTests.CodeActionTests.<UnusedOpenDeclarations>d__0.MoveNext() in /_/vsintegration/tests/FSharp.Editor.IntegrationTests/CodeActionTests.cs:line 33
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
  Passed FSharp.Editor.IntegrationTests.CodeActionTests.AddMissingFunKeyword (VS2022) [2 s]
  Passed FSharp.Editor.IntegrationTests.CreateProjectTests.ConsoleApp (VS2022) [8 s]
  Passed FSharp.Editor.IntegrationTests.CreateProjectTests.ClassLibrary (VS2022) [536 ms]
  Passed FSharp.Editor.IntegrationTests.CreateProjectTests.XUnitTestProject (VS2022) [427 ms]
  Passed FSharp.Editor.IntegrationTests.GoToDefinitionTests.FsiAndFsFilesGoToCorrespondentDefinitions (VS2022) [19 s]
  Passed FSharp.Editor.IntegrationTests.GoToDefinitionTests.GoesToDefinition (VS2022) [3 s]

@psfinaki
Copy link
Contributor

psfinaki commented Sep 4, 2023

Sorry I don't understand this error

The error is unrelated, sorry for this, int tests fail once in a while. Looks like rebuild helped.

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!

@0101
Copy link
Contributor

0101 commented Oct 10, 2023

This would be a breaking change. Maybe we should consider adding a new constructor with the new behavior.

@Lanayx
Copy link
Contributor

Lanayx commented Dec 22, 2023

This would be a breaking change

Do you mean somebody was relying on sending messages after mailbox disposal and that behaviour should be preserved?

@vzarytovskii
Copy link
Member

This would be a breaking change

Do you mean somebody was relying on sending messages after mailbox disposal and that behaviour should be preserved?

Now it will throw on post if it's disposed.

@vzarytovskii
Copy link
Member

@rstm-sf It's now a runtime breaking change (since new exception will be thrown at runtime, if Post is called on a disposed instance of the mailbox), I propose we either:

  1. Don't throw exception at runtime, and just silently swallow it.
  2. Add new Post overload method, which will accept an additional flag which will tell mailbox to throw.
  3. Add new constructor, which will set flag for current mailbox, based on which it will either throw or not (with default value to not throw for backwards compatibility).

Copy link
Contributor

github-actions bot commented Mar 10, 2024

✅ No release notes required

@rstm-sf
Copy link
Contributor Author

rstm-sf commented Mar 10, 2024

@rstm-sf It's now a runtime breaking change (since new exception will be thrown at runtime, if Post is called on a disposed instance of the mailbox), I propose we either:

1. Don't throw exception at runtime, and just silently swallow it.

2. Add new `Post` overload method, which will accept an additional flag which will tell mailbox to throw.

3. Add new constructor, which will set flag for current mailbox, based on which it will either throw or not (with default value to **not** throw for backwards compatibility).

I've done all the steps, but 2 seems like a lot

@vzarytovskii
Copy link
Member

@rstm-sf It's now a runtime breaking change (since new exception will be thrown at runtime, if Post is called on a disposed instance of the mailbox), I propose we either:

1. Don't throw exception at runtime, and just silently swallow it.
2. Add new `Post` overload method, which will accept an additional flag which will tell mailbox to throw.
3. Add new constructor, which will set flag for current mailbox, based on which it will either throw or not (with default value to **not** throw for backwards compatibility).

I've done all the steps, but 2 seems like a lot

Wait, no, I meant we do either for those three, not all. New constructor sounds like a good middle ground

Copy link
Member

@vzarytovskii vzarytovskii left a comment

Choose a reason for hiding this comment

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

Thanks

@psfinaki psfinaki enabled auto-merge (squash) March 11, 2024 11:06
@psfinaki psfinaki merged commit a5763f1 into dotnet:main Mar 20, 2024
@rstm-sf rstm-sf deleted the bugfix/After_dispose_is_called,_mailbox_should_stop_receiving_and_processing_messages branch March 20, 2024 14:07
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.

MailboxProcessor still process messages(and receives) after Dispose is invoked
6 participants