Remove .Result
inside Client.MaybeClose
method
#222
Closed
iuribrindeiro
started this conversation in
Ideas
Replies: 3 comments 2 replies
-
Thank you. |
Beta Was this translation helpful? Give feedback.
1 reply
-
you are right. We have to add We are working on |
Beta Was this translation helpful? Give feedback.
0 replies
-
@iuribrindeiro do you have a chance to test #230 ? it should solve the problem |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm facing the following error when trying to close a connection:
See this issue #25 for historical discussion
After cloning and debugging the source code of this library, I figured out that there is a
Task.Result
under theClient.MaybeClose
method. I don't really understand why we couldn't just makeMaybeClose
return typeasync Task<CloseResponse>
andawait
on that particular task there. Not sure if there is a reason for that. But I would like to mention that I can't even create a connection when the currentSynchronizationContext
runs on the main thread because there is no.ConfigureAwait(false)
underStreamSystem.Create
, for example. Is there a reason why we don't useConfigureAwait(false)
very often? According to this microsoft blog post libraries should use this to prevent getting the current applicationSynchronizationContext
and cause a deadlock (like what is happening toClient.MaybeClose
).Here is a repo that reproduces this issue by implementing a custom single thread
SynchronizationContext
: https://github.com/iuribrindeiro/RabbitMQThreadIssueI'm up to raise a PR to fix this, if that is the case.
Beta Was this translation helpful? Give feedback.
All reactions