-
Notifications
You must be signed in to change notification settings - Fork 543
Fixing the handling of detach errors #1030
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
Conversation
Co-authored-by: Artur Souza <[email protected]>
The pubsub/nats component was replaced by pubsub/natsstreaming as part of dapr/dapr#2003, but the corresponding code in dapr/components-contrib was not removed, so this change removes it.
pkedy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments for reviewers
| a.logger.Error(innerErr) | ||
| var detachError *amqp.DetachError | ||
| var ampqError *amqp.Error | ||
| if errors.Is(innerErr, detachError) || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*amqp.Error is the most likely terror received, but I'm also detecting *amqp.DetachError in case.
| } | ||
|
|
||
| return fmt.Errorf("%s error receiving message on topic %s, %s", errorMessagePrefix, s.topic, err) | ||
| return fmt.Errorf("%s error receiving message on topic %s, %w", errorMessagePrefix, s.topic, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using %w is required to wrap the underlying AMQP error so it can be detected by errors.Is/errors.As.
|
Please, change it to the release branch. We merge release into master. |
Codecov Report
@@ Coverage Diff @@
## master #1030 +/- ##
==========================================
+ Coverage 34.03% 34.21% +0.18%
==========================================
Files 133 132 -1
Lines 10750 10769 +19
==========================================
+ Hits 3659 3685 +26
+ Misses 6710 6699 -11
- Partials 381 385 +4
Continue to review full report at Codecov.
|
* Fixing the handling of detach errors (#1030) * Improve error message in case of missing property (#1012) Co-authored-by: Artur Souza <[email protected]> * Remove vestigial pubsub/nats code (#1024) The pubsub/nats component was replaced by pubsub/natsstreaming as part of dapr/dapr#2003, but the corresponding code in dapr/components-contrib was not removed, so this change removes it. * Fixing the handling of detach errors Co-authored-by: Maarten Mulders <[email protected]> Co-authored-by: Artur Souza <[email protected]> Co-authored-by: Simon Leet <[email protected]> * Revert "Fixing the handling of detach errors (#1030)" (#1031) This reverts commit 54840c2. * Fixing the handling of detach errors (#1032) Co-authored-by: Maarten Mulders <[email protected]> Co-authored-by: Artur Souza <[email protected]> Co-authored-by: Simon Leet <[email protected]>
* Fixing the handling of detach errors (dapr#1030) * Improve error message in case of missing property (dapr#1012) Co-authored-by: Artur Souza <[email protected]> * Remove vestigial pubsub/nats code (dapr#1024) The pubsub/nats component was replaced by pubsub/natsstreaming as part of dapr/dapr#2003, but the corresponding code in dapr/components-contrib was not removed, so this change removes it. * Fixing the handling of detach errors Co-authored-by: Maarten Mulders <[email protected]> Co-authored-by: Artur Souza <[email protected]> Co-authored-by: Simon Leet <[email protected]> * Revert "Fixing the handling of detach errors (dapr#1030)" (dapr#1031) This reverts commit 54840c2. * Fixing the handling of detach errors (dapr#1032) Co-authored-by: Maarten Mulders <[email protected]> Co-authored-by: Artur Souza <[email protected]> Co-authored-by: Simon Leet <[email protected]>
Description
This fixes the handling of
amqp:link:detach-forcederrors from Azure Service Bus. While the log message can be suppressed, this type of error should not be ignored because it prevents the component from reconnecting. Reconnecting is the desired behavior when the link is force detached.Issue reference
Resolves dapr/dapr#3468
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: