-
Notifications
You must be signed in to change notification settings - Fork 595
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
kncloudevents now uses a singleton http client #4465
kncloudevents now uses a singleton http client #4465
Conversation
Now every new message sender always reuse the same underlying client, whenever possible Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
This is an important fix, do we want it before or after the release? |
Codecov Report
@@ Coverage Diff @@
## master #4465 +/- ##
==========================================
+ Coverage 81.19% 81.25% +0.06%
==========================================
Files 281 282 +1
Lines 7981 8003 +22
==========================================
+ Hits 6480 6503 +23
Misses 1112 1112
+ Partials 389 388 -1
Continue to review full report at Codecov.
|
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
pkg/reconciler/inmemorychannel/dispatcher/testdata/config-event-dispatcher.yaml
Outdated
Show resolved
Hide resolved
pkg/reconciler/inmemorychannel/dispatcher/testdata/config-event-dispatcher.yaml
Outdated
Show resolved
Hide resolved
pkg/reconciler/inmemorychannel/dispatcher/testdata/config-event-dispatcher.yaml
Outdated
Show resolved
Hide resolved
|
||
return &HTTPMessageSender{Client: client, Target: target}, nil | ||
func NewHTTPMessageSenderWithTarget(target string) (*HTTPMessageSender, error) { | ||
return &HTTPMessageSender{Client: getClient(), Target: target}, nil |
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.
Just an observation/thought, probably silly, but if we pass in here interface to how to get the client, we don't need the global resync at the cost of the doing the Read lock on the mutex guarding the client. This might make it easier to write tests also? Curious on what the overhead for a read mutex would be.
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.
I completely disagree with this idea 😄 Putting a lock, shared between all dispatchers in the instance, on the hot path, doesn't sound at all like a good idea IMO.
To be honest, I think the configuration of these http params shouldn't be allowed at all during the execution of the dispatcher. It should be a single read when the process is started and that's it. These are params that are usually configured only at setup time, when you "setup" the capacity of your deployments: you don't change it on fly.
If you do, then you expect in any case a sort of "downtime"... So what I did in this PR is that I've done the bare minimum to fix the issue, I would love to open later a discussions on these params and why they should be configurable only at startup (and not like watches)
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.
Yeah, just jotted it down :) I figured you'd be a fan :)
I'm curious also on how often these in practice need to change.
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.
I guess never, hence my idea of removing that watch
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.
If that complexity is not needed in the first place, removing it in another PR sounds like an excellent idea to me. Does anyone know if there is/was a use-case in Eventing for reconfiguring the transport on the fly?
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.
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
/lgtm |
/hold for another pass |
The following is the coverage report on the affected files.
|
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: matzew, slinkydeveloper 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 |
Backporting to 0.17 and 0.18 |
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com> Co-authored-by: Francesco Guardiani <francescoguard@gmail.com>
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
* Update pingsource-mt-adapter.yaml * Like on 0.18.3, we skip the tracing tests Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * [release-0.18] Retry on network failures (knative#4454) (knative#4457) * Retry on network failures (knative#4454) Signed-off-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com> * nethttp -> http Signed-off-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com> * Backport knative#4465 (knative#4468) Signed-off-by: Francesco Guardiani <francescoguard@gmail.com> * [0.18] Backport knative#4466 (knative#4471) * Remove double invocations to responseWriter.WriteHeader in filter handler (knative#4466) * Fix knative#4464 Signed-off-by: Francesco Guardiani <francescoguard@gmail.com> * Docs Signed-off-by: Francesco Guardiani <francescoguard@gmail.com> * Moar tests Signed-off-by: Francesco Guardiani <francescoguard@gmail.com> * Linting Signed-off-by: Francesco Guardiani <francescoguard@gmail.com> * Nit with metrics Signed-off-by: Francesco Guardiani <francescoguard@gmail.com> (cherry picked from commit a6fc540) Signed-off-by: Francesco Guardiani <francescoguard@gmail.com> * Nit Signed-off-by: Francesco Guardiani <francescoguard@gmail.com> * fixed wrong marshall in apiserversouece which will fix the missing ceOverrides extension (knative#4477) (knative#4480) * fixed wrong marshall * fixed UT * [0.18] Readyness probe in broker ingress (knative#4483) * Fix knative#4473 Signed-off-by: Francesco Guardiani <francescoguard@gmail.com> * Massage the filter yaml Signed-off-by: Francesco Guardiani <francescoguard@gmail.com> Co-authored-by: Matthias Wessendorf <mwessend@redhat.com> Co-authored-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com> Co-authored-by: Francesco Guardiani <francescoguard@gmail.com> Co-authored-by: capri-xiyue <52932582+capri-xiyue@users.noreply.github.com>
Fix #4461
Signed-off-by: Francesco Guardiani francescoguard@gmail.com
Proposed Changes