Skip to content
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

Adds timeout to dispatcher. #687

Merged
merged 4 commits into from Apr 21, 2022

Conversation

gab-satchi
Copy link
Contributor

  • hardcoded timeout of 30s
  • modified tests

Changes

  • 🎁 Adds timeout for dispatcher communication with subscriber

NOTE: this change adds about 30s to our unit tests as the timeout is currently not configurable. It didn't make sense to make it configurable just for the tests.
If we choose to make it configurable to the user, we could use the same mechanism to start the dispatcher with lower timeouts for testing.

/kind enhancement

Fixes #671

- dispatcher will timeout after 30s when sending to the subscriber

@knative-prow knative-prow bot added kind/enhancement size/L Denotes a PR that changes 100-499 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Apr 4, 2022
@@ -42,6 +42,7 @@ func display(event cloudevents.Event) {
}

func main() {
flag.Parse()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change is unrelated to this PR. Just something I saw was missing while testing out changes.

@codecov
Copy link

codecov bot commented Apr 4, 2022

Codecov Report

Merging #687 (efd60ee) into main (9b5722c) will decrease coverage by 1.34%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #687      +/-   ##
==========================================
- Coverage   76.02%   74.67%   -1.35%     
==========================================
  Files          32       35       +3     
  Lines        2419     2492      +73     
==========================================
+ Hits         1839     1861      +22     
- Misses        511      562      +51     
  Partials       69       69              
Impacted Files Coverage Δ
pkg/dispatcher/dispatcher.go 70.86% <100.00%> (+0.94%) ⬆️
pkg/reconciler/trigger/resources/dispatcher.go 91.07% <100.00%> (+0.68%) ⬆️
pkg/utils/http.go 100.00% <100.00%> (ø)
pkg/utils/envconfig.go 0.00% <0.00%> (ø)
pkg/utils/filter.go 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9b5722c...efd60ee. Read the comment docs.

@gab-satchi
Copy link
Contributor Author

/retest

@gab-satchi
Copy link
Contributor Author

gab-satchi commented Apr 5, 2022

/hold

got some temporary commits on here

@knative-prow knative-prow bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 5, 2022
@salaboy
Copy link

salaboy commented Apr 7, 2022

@gab-satchi we discussed this feature in yesterday's Eventing WG, and because the Kafka folks already have this implemented, they are thinking to promote the feature out of experimental and even pushing some changes to the spec (I haven't reviewed that yet). I believe this is a great way to start engaging with upstream, so we can follow the change all the way up to the spec.

@gab-satchi
Copy link
Contributor Author

I think it will be great to add this to the upstream spec. It may make sense to have this default timeout in place as a stopgap to prevent connections being held forever at the dispatcher.

Once the eventing core work is done, we can modify this to check there for a timeout and fallback to the default.

@lionelvillard
Copy link
Contributor

There is a PR to add this to the spec: knative/specs#76.

@gab-satchi
Copy link
Contributor Author

/hold cancel
/retest

@knative-prow knative-prow bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 12, 2022
@gabo1208
Copy link
Contributor

Is this ready to review cc @gab-satchi ?

@gab-satchi
Copy link
Contributor Author

yes it's ready @gabo1208. the 30s timeout will be stopgap while we work on making it configurable in the spec

@gab-satchi
Copy link
Contributor Author

/hold

will update to use the experimental feature in deliverySpec

@knative-prow knative-prow bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 13, 2022
@gab-satchi gab-satchi force-pushed the server-timeouts branch 3 times, most recently from 56be470 to 057d290 Compare April 14, 2022 19:12
@gab-satchi
Copy link
Contributor Author

/retest
/hold cancel

@knative-prow knative-prow bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 18, 2022
@gab-satchi
Copy link
Contributor Author

/retest

@gab-satchi gab-satchi closed this Apr 19, 2022
@gab-satchi gab-satchi reopened this Apr 19, 2022
@gab-satchi
Copy link
Contributor Author

/retest

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Apr 21, 2022
@knative-prow
Copy link

knative-prow bot commented Apr 21, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gab-satchi, gabo1208

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:
  • OWNERS [gab-satchi,gabo1208]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow bot merged commit 5af45dc into knative-extensions:main Apr 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/enhancement lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
4 participants