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

Deadlock when sending message inside ApplicationMessageReceivedHandler #731

Closed
paolofulgoni opened this issue Aug 1, 2019 · 8 comments
Closed
Labels
bug Something isn't working duplicate This issue or pull request already exists support Support is needed

Comments

@paolofulgoni
Copy link

paolofulgoni commented Aug 1, 2019

Describe the bug

If I try to publish a message with AtLeastOnce QoS from the ApplicationMessageReceivedHandler, the message is correctly sent, but the execution of the handler is stuck. It looks like a deadlock.

Everything is working fine with AtMostOnce QoS

Which project is your bug related to?

Client

To Reproduce

I changed a test so that it fails, showing the issue: paolofulgoni@d351a72

Expected behavior

I expect the handler to continue the execution.

@paolofulgoni
Copy link
Author

I guess that the Task.Run that I removed from the test was there because of this issue, right?

@SeppPenner
Copy link
Collaborator

Which issue? This one #158?

@SeppPenner SeppPenner added bug Something isn't working support Support is needed labels Aug 1, 2019
@paolofulgoni
Copy link
Author

No, I wasn't referring to that issue. I meant that when @chkr1011 wrote that test, he probably added the Task.Run as a workaround because otherwise the test would fail.

https://github.com/chkr1011/MQTTnet/blob/7aa4d5159c6c8a03b0cce3320beb3c83c5e5fc31/Tests/MQTTnet.Core.Tests/MqttClient_Tests.cs#L40

@SeppPenner
Copy link
Collaborator

Ah, okay. Yeah, it might be like that.

@paolofulgoni
Copy link
Author

it may be a duplicate of #648

@SeppPenner
Copy link
Collaborator

This seems to be very similar, yes.

@SeppPenner SeppPenner added the duplicate This issue or pull request already exists label Aug 1, 2019
@paolofulgoni
Copy link
Author

OK, so I'm closing the issue. Thanks

@SeppPenner
Copy link
Collaborator

Just for reference again: Check out @chkr1011's comments under #648 (comment) and #648 (comment) to find workarounds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists support Support is needed
Projects
None yet
Development

No branches or pull requests

2 participants