-
Notifications
You must be signed in to change notification settings - Fork 5
Conversation
Looks good. Some possible considerations:
|
Since we call
|
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.
Now that I actually manage to think; (generally) execution needs to be paused in the problematic thread as well.
Otherwise we risk e.g. failing to initialize configuration, noting that and requesting shutdown but still continue initialisation and getting a panic from using a nil.
Replacing the shutdown() and log.Fatalf() lines in |
Yes, that's more of a style/consistency issue whereas;
Is a parallelization issue - it seems certainly plausible that after signalling the shutdown (the channel has room), the thread were the error occurs goes on with the next thing and panics as previous initialization has failed before the goroutine responsible for shutdown gets a chance to read from the channel. |
Now it is nil pointer safe as well |
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## master #517 +/- ##
==========================================
- Coverage 40.48% 38.64% -1.84%
==========================================
Files 13 13
Lines 3048 3206 +158
==========================================
+ Hits 1234 1239 +5
- Misses 1771 1924 +153
Partials 43 43
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
I'm not sure if it's unclear, but the problem I see (#517 (review)) is a race condition, in short I think all instances where there are problems should be e.g.
obviously, that requires moving at least the goroutine to do the actual shutdown up top. It "probably" works anyway, but the way I see it that (or some other way of holding execution in the problematic flow) is needed for correctness. (It may of course be that I'm wrong, but then it'd be nice to understand how.) |
The removal of Utilizing the
|
I don't think this normally would break in practice so I don't want to hold it up but still do not consider it correct enough that I want to approve it.
The changes look reasonable to me but I would like to see some test cases, preferably in the form of code. This would help have a better picture of what to expect, given that we would like the pipeline's behavior to be as predictable as possible. |
Hard to have a coded test case that simulates an external |
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.
Does this fix #412 if not i suspect we might need to rewrite a bit some of the mq graceful shutdown for that as well.
there is an mention here: https://github.com/rabbitmq/amqp091-go/blob/main/doc.go#L107-L146
I don't see that this should have any bearing on that - but then again, the suggested thing is already done and if an error is detected, the service bails out, so I'm not sure what happens when that stall occurs. |
Should be an easy fix since we already has the functionality for connection errors |
i did encounter it a couple of times, but was not able to reproduce it at all consistently. rabbitmq/amqp091-go#123 is the only related thing i have about it |
the error looks like: streadway/amqp#518 |
84c8092
to
ee09417
Compare
Rebased on main |
ee09417
to
f1ed72a
Compare
f1ed72a
to
e48834b
Compare
Converting to draft since it probably will not have time to be implemented before we merge the repos. |
Will be implemented in the merged repo. |
log.Fatal
to make sure we exit cleanly in all cases.