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

Bug 1908707: fluentd fails to deliver message with Server returned nothing #73

Merged
merged 3 commits into from
Feb 2, 2021

Conversation

syedriko
Copy link
Contributor

Description

Fix for https://bugzilla.redhat.com/show_bug.cgi?id=1908707.
Make net/http transport timeouts and limits configurable. Increase the default HTTP server read/write/idle timeouts from 5 seconds to 1 minute.
/cc @jcantrill
/assign @ewolinetz

@openshift-ci-robot openshift-ci-robot added bugzilla/severity-urgent Referenced Bugzilla bug's severity is urgent for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Jan 30, 2021
@openshift-ci-robot
Copy link

@syedriko: This pull request references Bugzilla bug 1908707, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.7.0) matches configured target release for branch (4.7.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1908707: fluentd fails to deliver message with Server returned nothing

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.

@jcantrill
Copy link
Contributor

/approve

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 30, 2021
@syedriko
Copy link
Contributor Author

/test cluster-logging-operator-e2e

@syedriko syedriko changed the title Bug 1908707: fluentd fails to deliver message with Server returned nothing WIP Bug 1908707: fluentd fails to deliver message with Server returned nothing Jan 31, 2021
@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 31, 2021
…thing

Corrected syntax of flags declarations, added unit tests for the new flags.
@syedriko syedriko changed the title WIP Bug 1908707: fluentd fails to deliver message with Server returned nothing Bug 1908707: fluentd fails to deliver message with Server returned nothing Jan 31, 2021
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 31, 2021
@syedriko
Copy link
Contributor Author

/test cluster-logging-operator-e2e

Copy link
Contributor

@jcantrill jcantrill left a comment

Choose a reason for hiding this comment

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

Few nits that I am not firm on the necessity to resolve in the PR. I leave it to you , but otherwise lgtm

AuthBackEndRoles: map[string]BackendRoleConfig{},
AuthWhiteListedNames: []string{},
AuthAdminRole: "",
HTTPReadTimeout: time.Duration(1) * time.Minute,
Copy link
Contributor

Choose a reason for hiding this comment

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

For consistency, should we choose the same unit and apply it to all config?

Copy link
Contributor Author

@syedriko syedriko Feb 1, 2021

Choose a reason for hiding this comment

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

I think this dovetails with the next comment. For consistency we'd need to go with the smallest unit we're likely to encounter, which is millisecond, and express a minute as time.Duration(60000) * time.Millisecond. This is arguably more difficult to read than time.Duration(1) * time.Minute. I'm leaning towards the easiest to read - the smallest value with the right units factor.

Copy link
Contributor

Choose a reason for hiding this comment

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

Per my other comment, as long as the CLI allows us to specify a duration I am satisfied leaving these as-is

@@ -37,5 +37,18 @@ func newFlagSet() *flag.FlagSet {
flagSet.String("auth-admin-role", "", "The name of the only role that will be passed on the request if it is found in the list of roles")
flagSet.String("auth-default-role", "", "The role given to every request unless it has the auth-admin-role")

//net/http.Server timeouts for the server side of the proxy
flagSet.Duration("http-read-timeout", time.Duration(1)*time.Minute, "The maximum duration for reading the entire HTTP request. Zero means no timeout.")
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we expand the flags to identify the unit? e.g http-read-timeout-sec

Copy link
Contributor Author

@syedriko syedriko Feb 1, 2021

Choose a reason for hiding this comment

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

That was my first impulse, too, but I don't think it's the right thing. A flag of type time.Duration accepts many different time units, from nanoseconds to hours. See https://golang.org/pkg/flag/#Duration. Under the covers, https://golang.org/pkg/time/#ParseDuration does the parsing. I had fun with it at https://github.com/syedriko/elasticsearch-proxy/blob/f16618abbf400e2f3536c257df9bcc2cc52e86cf/pkg/config/options_test.go#L320

Copy link
Contributor

Choose a reason for hiding this comment

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

Can i define a proper duration in configuration on the CLI? It will let me use say 1s or 10m? If so, I'm good as-is

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It will even let you define --http-expect-continue-timeout=1h2m3s4ms5us6ns if you so desire.

pkg/config/options.go Outdated Show resolved Hide resolved
@syedriko
Copy link
Contributor Author

syedriko commented Feb 2, 2021

/test cluster-logging-operator-e2e

Copy link
Contributor

@jcantrill jcantrill left a comment

Choose a reason for hiding this comment

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

/lgtm
/retest

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 2, 2021
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jcantrill, syedriko

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jcantrill
Copy link
Contributor

/cherrypick release-4.6
/cherrypick release-4.5

@openshift-cherrypick-robot

@jcantrill: once the present PR merges, I will cherry-pick it on top of release-4.6 in a new PR and assign it to you.

In response to this:

/cherrypick release-4.6
/cherrypick release-4.5

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.

@openshift-merge-robot openshift-merge-robot merged commit c29db5d into openshift:master Feb 2, 2021
@openshift-ci-robot
Copy link

@syedriko: All pull requests linked via external trackers have merged:

Bugzilla bug 1908707 has been moved to the MODIFIED state.

In response to this:

Bug 1908707: fluentd fails to deliver message with Server returned nothing

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.

@openshift-cherrypick-robot

@jcantrill: #73 failed to apply on top of branch "release-4.6":

Applying: Bug 1908707: fluentd fails to deliver message with Server returned nothing
Using index info to reconstruct a base tree...
M	pkg/config/options.go
M	pkg/proxy/server.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/proxy/server.go
Auto-merging pkg/config/options.go
CONFLICT (content): Merge conflict in pkg/config/options.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Bug 1908707: fluentd fails to deliver message with Server returned nothing
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherrypick release-4.6
/cherrypick release-4.5

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.

syedriko added a commit to syedriko/elasticsearch-proxy that referenced this pull request Feb 2, 2021
Bug 1924258: fluentd fails to deliver message with Server returned nothing
syedriko added a commit to syedriko/elasticsearch-proxy that referenced this pull request Feb 2, 2021
Bug 1924258: fluentd fails to deliver message with Server returned nothing
syedriko added a commit to syedriko/elasticsearch-proxy that referenced this pull request Feb 2, 2021
Bug 1924329: fluentd fails to deliver message with Server returned nothing
@syedriko syedriko deleted the bz_1908707 branch April 2, 2021 22:55
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. bugzilla/severity-urgent Referenced Bugzilla bug's severity is urgent for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants