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

Make FillUntil errors non-fatal #285

Merged
merged 5 commits into from
May 5, 2020
Merged

Conversation

stephen-soltesz
Copy link
Contributor

@stephen-soltesz stephen-soltesz commented May 2, 2020

While investigating a higher than expected error rate from the throttled ndt5-client used in the e2e monitoring with access tokens, I discovered that the cause of failure from the client perspective was the server handling FillUntil errors as fatal.

FillUntil in prometheus metrics is the second most frequent error from clients. In the case of the ndt5-client, the error is a result of two steps:

After the 15sec timeout, the client closes the test connection. Because the server was blocked in a write, the write returns an error and returns from FillUntil. When the server aborts the test, the client also registers a failure.

This PR prevents that failure by ignoring the FillUntil error and continuing to collect connection metrics and sending them to the client via the control channel. If the client has truly disconnected, there are additional opportunities for error: sending results, receiving client performance, sending all metrics, sending test finalize.


This change is Reviewable

@coveralls
Copy link
Collaborator

coveralls commented May 2, 2020

Pull Request Test Coverage Report for Build 1279

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.3%) to 79.932%

Files with Coverage Reduction New Missed Lines %
ndt5/c2s/c2s.go 1 72.32%
Totals Coverage Status
Change from base Build 1275: 0.3%
Covered Lines: 1649
Relevant Lines: 2063

💛 - Coveralls

@stephen-soltesz stephen-soltesz changed the title Change error handling so FillUntil is non-fatal SetWriteDeadline on Download and make FillUntil errors non-fatal May 4, 2020
@stephen-soltesz stephen-soltesz changed the title SetWriteDeadline on Download and make FillUntil errors non-fatal SetWriteDeadline and make FillUntil errors non-fatal May 4, 2020
@stephen-soltesz
Copy link
Contributor Author

@pboothe I think you're the right person to review this. I won't expect a response until Tuesday.

Copy link
Contributor

@pboothe pboothe left a comment

Choose a reason for hiding this comment

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

LGTM once the SetWriteDeadline stuff is removed.

Reviewable status: :shipit: complete! 1 of 1 approvals obtained (waiting on @pboothe and @stephen-soltesz)


ndt5/protocol/protocol.go, line 184 at r3 (raw file):

func (ws *wsConnection) FillUntil(t time.Time, bytes []byte) (bytesWritten int64, err error) {
	ws.SetWriteDeadline(t)

SetWriteDeadline is a deep deep rabbithole, and I have been burned by it in the past. After talking in person, we agreed to remove those changes from this PR.

https://golang.org/src/net/net.go?s=8402:8452#L248
https://golang.org/src/net/fd_unix.go?h=netFD#L19
https://golang.org/src/internal/poll/fd_poll_runtime.go?s=3141:3190#L27
https://github.com/golang/go/blob/master/src/runtime/netpoll.go#L241


ndt5/s2c/s2c.go, line 99 at r3 (raw file):

	record.StartTime = time.Now()
	testConn.FillUntil(time.Now().Add(10*time.Second), dataToSend)
	record.EndTime = time.Now()

The changes to S2C look good to me.

Copy link
Contributor Author

@stephen-soltesz stephen-soltesz left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 1 of 1 approvals obtained (waiting on @pboothe)


ndt5/protocol/protocol.go, line 184 at r3 (raw file):

Previously, pboothe (Peter Boothe) wrote…

SetWriteDeadline is a deep deep rabbithole, and I have been burned by it in the past. After talking in person, we agreed to remove those changes from this PR.

https://golang.org/src/net/net.go?s=8402:8452#L248
https://golang.org/src/net/fd_unix.go?h=netFD#L19
https://golang.org/src/internal/poll/fd_poll_runtime.go?s=3141:3190#L27
https://github.com/golang/go/blob/master/src/runtime/netpoll.go#L241

Removed.

@stephen-soltesz stephen-soltesz changed the title SetWriteDeadline and make FillUntil errors non-fatal Make FillUntil errors non-fatal May 5, 2020
@stephen-soltesz stephen-soltesz merged commit 25ae054 into master May 5, 2020
@stephen-soltesz stephen-soltesz deleted the sandbox-soltesz-fix branch May 5, 2020 16:39
@stephen-soltesz
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants