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

Traffic Ops: log a warning instead of ignoring write errors #5984

Merged
merged 1 commit into from
Jul 1, 2021

Conversation

rawlinp
Copy link
Contributor

@rawlinp rawlinp commented Jun 29, 2021

What does this PR (Pull Request) do?

Which Traffic Control components are affected by this PR?

  • Traffic Ops

What is the best way to verify this PR?

Ensure the TO API tests still pass. Since this logging only happens on write errors, one way to test the logging would be to set the traffic_ops_golang.request_timeout in cdn.conf to 1 and make a request to a certain endpoint which is known to take longer than 1 second to return a response. Alternatively, you could add a time.sleep(5*time.Second) into some handler and call that instead. You should see a log like the following:

WARNING: api.go:120: 2021-06-29T21:44:57.123243Z: failed to write response (method = GET, URL = /api/3.1/ping, request ID = 1, remote addr = [::1]:62136, bytes written = 0): http: Handler timeout

If this is a bug fix, what versions of Traffic Control are affected?

4.x, 5.x, master

The following criteria are ALL met by this PR

  • minor logging fixes, tests didn't seem necessary
  • logging fixes, no docs needed
  • This PR includes an update to CHANGELOG.md
  • This PR includes any and all required license headers
  • This PR DOES NOT FIX A SERIOUS SECURITY VULNERABILITY (see the Apache Software Foundation's security guidelines for details)

@rawlinp rawlinp added bug something isn't working as intended Traffic Ops related to Traffic Ops labels Jun 29, 2021
Copy link
Contributor

@srijeet0406 srijeet0406 left a comment

Choose a reason for hiding this comment

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

Changes look good.
Unit + API tests pass.
Manual testing resulted in the log line being generated.
LGTM!

@mattjackson220 mattjackson220 merged commit 5227543 into apache:master Jul 1, 2021
@rawlinp rawlinp deleted the fix-to-ignore-write-errors branch July 1, 2021 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something isn't working as intended Traffic Ops related to Traffic Ops
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Traffic Ops HTTP response write errors are ignored
3 participants