Skip to content

fix crash when pingsource adapter is scaled up without any sources#4242

Merged
knative-prow-robot merged 2 commits into
knative:masterfrom
lionelvillard:fix-timeout
Oct 8, 2020
Merged

fix crash when pingsource adapter is scaled up without any sources#4242
knative-prow-robot merged 2 commits into
knative:masterfrom
lionelvillard:fix-timeout

Conversation

@lionelvillard
Copy link
Copy Markdown
Contributor

No description provided.

@google-cla google-cla Bot added the cla: yes Indicates the PR's author has signed the CLA. label Oct 7, 2020
@knative-prow-robot knative-prow-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Oct 7, 2020
value: ''
- name: K_SINK_TIMEOUT
value: ''
value: '0'
Copy link
Copy Markdown
Contributor

@antoineco antoineco Oct 7, 2020

Choose a reason for hiding this comment

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

Wouldn't it be more graceful to handle an empty K_SINK_TIMEOUT instead? E.g. default to 0 if K_SINK_TIMEOUT == ""

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We could but I don't think that's necessary. This is not the only env var that will cause a pod to crash is not set properly by the operator.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not too comfortable with that, and it's exactly what is called the broken window theory: if we have something that's already shaky there is less remorse to introduce another shaky piece to the puzzle.

Just because it's 0 in config/ doesn't mean every user will use that manifest. Sooner or later someone will omit the var and report that same crash again.

We can make things right about K_SINK_TIMEOUT in particular in this PR, and tackle other occurrences of unsafe env var handling in subsequent PRs. I'm happy to help if it's just a matter of time for you.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yup agree. Fixing...

@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 7, 2020

Codecov Report

Merging #4242 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4242   +/-   ##
=======================================
  Coverage   79.93%   79.93%           
=======================================
  Files         277      277           
  Lines        7725     7725           
=======================================
  Hits         6175     6175           
  Misses       1170     1170           
  Partials      380      380           

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 5deb379...7530718. Read the comment docs.

@knative-test-reporter-robot
Copy link
Copy Markdown

The following jobs failed:

Test name Triggers Retries
pull-knative-eventing-upgrade-tests 0/3

Failed non-flaky tests preventing automatic retry of pull-knative-eventing-upgrade-tests:

.Test

@n3wscott
Copy link
Copy Markdown
Contributor

n3wscott commented Oct 7, 2020

You need add an e2e test for this.

@lionelvillard
Copy link
Copy Markdown
Contributor Author

agree for the e2e test. However it's a big effort for an edge case and a bit risky for a fix that needs to be backported.

@knative-prow-robot knative-prow-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Oct 8, 2020
@knative-metrics-robot
Copy link
Copy Markdown

The following is the coverage report on the affected files.
Say /test pull-knative-eventing-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/adapter/v2/config.go 57.4% 61.5% 4.1

@knative-prow-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: antoineco, lionelvillard

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

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

@antoineco
Copy link
Copy Markdown
Contributor

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 8, 2020
@knative-prow-robot knative-prow-robot merged commit 57358d4 into knative:master Oct 8, 2020
matzew pushed a commit to matzew/eventing that referenced this pull request Dec 7, 2020
…native#4242)

* fix crash when pingsource adapter is scaled up without any sources

* K_SINK_TIMEOUT now accepts any string value
openshift-merge-robot pushed a commit to openshift/knative-eventing that referenced this pull request Dec 7, 2020
…native#4242) (#1020)

* fix crash when pingsource adapter is scaled up without any sources

* K_SINK_TIMEOUT now accepts any string value

Co-authored-by: Lionel Villard <villard@us.ibm.com>
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. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants