Make in-memory-channel dispatcher non-blocking#713
Conversation
|
@scothis: GitHub didn't allow me to assign the following users: adamharwayne. Note that only knative members and repo collaborators can be assigned. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: scothis The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/assign @Harwayne |
|
This is similar functionality to what #708 is trying to add. The main difference being that #708 is changing the functionality on a new |
|
I missed #708, ships crossing in the night...
I'm not sure which one you're asking about, but I don't think a blocking channel is useful and in fact is harmful, never mind inefficient. Any channel implementation backed by messaging middleware will inherently decouple receiving an event from dispatching the event. A common source of bugs is when the semantics of an interface shift slightly depending on configuration external to the caller. Making each channel optionally blocking makes the ConfigMap more complex while only being meaningful in a very narrow use case. Channel arguments should be avoided unless absolutely necessary, particularly so for the default channel provider. |
The idea in #708 is not that the user can provide arguments to the
I now agree. We plan to remove the |
|
@scothis in general imho having additional option is always better, especially for the debugging, particularly with this PR, it does not seem to exercise this new behaviour. If we go with your PR, then could you please change e2e tests so both blocking and non-blocking path would be tested. In my PR I do see some strangeness happening when a non-blocking fanout handler is called. |
|
/close |
|
@scothis: Closing this PR. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Refs #535
The in-memory-channel currently holds the request open when receiving a new event until the event has been dispatched. If an error is encountered while dispatching, that error is reported back to the caller. This is in contrast to other channels which acknowledge receiving an event to the caller independent of dispatching the event to subscribers.
This behavior is leaking out of the fanout sidecar which when operating as a dispatching sidecar should be blocking. However, the in-memory-channel dispatcher is only the fanout sidecar. To my knowledge, the fanout sidecar is unused other than the in-memory-channel. Rather than scrap the sidecar, I made it optionally non-blocking.
Proposed Changes
Release Note
/assign @adamharwayne