-
Notifications
You must be signed in to change notification settings - Fork 600
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
Implement ReadOnlyInterface in IMC dispatcher #4675
Implement ReadOnlyInterface in IMC dispatcher #4675
Conversation
Ensures any running dispatcher can handle events for all InMemoryChannels, and not only the ones in the bucket it is leading.
if err := r.reconcile(ctx, imc); err != nil { | ||
return 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.
This is pretty much all this PR does: move the reconciliation logic to a (*Reconciler).reconcile()
method and call it from both ReconcileKind()
and ObserveKind()
.
The following is the coverage report on the affected files.
|
Codecov Report
@@ Coverage Diff @@
## master #4675 +/- ##
==========================================
- Coverage 81.07% 81.07% -0.01%
==========================================
Files 291 291
Lines 8212 8216 +4
==========================================
+ Hits 6658 6661 +3
- Misses 1153 1154 +1
Partials 401 401
Continue to review full report at Codecov.
|
Thanks for finding the issue. This PR does not change the existing logic, but simply implements the interface with existing reconcile logic. It looks safe to me. |
@zhongduo thanks for the review! Do you happen to know how I can re-run the failed test? It seems unrelated. |
/retest |
It is not uncommon that the downstream test itself has problem. But IIRC they are not required build for merge. |
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.
/kind bug
Can we have a regression test?
@pierDipi would a unit test suffice? I don't see e2e tests for the IMC. |
I see them here: Lines 39 to 42 in 9643baf
I think even running existing E2E tests with the IMC dispatcher scaled up should be enough. |
Ahh, thanks for the pointer 👍 |
@pierDipi e2e tests seem to be generic and run the same test suite for all channel types if I'm not mistaken. There is no existing test in which I could scale just the IMC dispatcher, and I can't scale channel dispatchers of any type because that would definitely break something. Besides, those tests send 1 event and ensure it arrived in the expected shape. To test this particular bug, I need to send a larger amount of events, which changes the way things are being asserted. For a useful regression test I would first have to come up with a completely new test suite it seems, and that sounds like a topic for a much bigger PR. |
This change looks like a great surgical change to make things better. As far as having regression tests, that would certainly be great but I agree with @antoineco that it should probably be in a follow on PR. It's maybe something that we can tackle as part of the #3590 since this would alleviate it as well? As far as the downstream failing test, it mosdef seems unrelated as it has something to do with dupes in vegeta testing:
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: antoineco, vaikas The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
👍 /unhold |
Fixes #4638
Proposed Changes
ReadOnlyInterface
in the IMC dispatcher.Ensures any running dispatcher can handle events for all InMemoryChannels, and not only the ones in the bucket it is leading.
After scaling the dispatcher to 5 replicas, I sent 100 events/s for 1 min to a Channel using
vegeta
and got a 100% success rate, versus ~20% before this change:Release Note
Docs