|
Ran
|
Jobs
1
|
Files
58
|
Run time
3s
|
Badge
README BADGES
|
push
travis-ci
<a href="https://github.com/couchbase/cbgt/commit/<a class=hub.com/couchbase/cbgt/commit/2aaaf3336fdc4f9c1f91791554b8231fc6196aa3">2aaaf3336<a href="https://github.com/couchbase/cbgt/commit/2aaaf3336fdc4f9c1f91791554b8231fc6196aa3">">MB-24249: Avoid handlers writing http response headers twice When encoding/json&#39;s NewEncoder()&#39;s Encode is invoked, for smaller responses the API succeeds and does not return a non-nil error. However in case of larger responses, an error is seen sometimes: &quot;write tcp 127.0.0.1:9200-&gt;127.0.0.1:49239: write: broken pipe&quot; This is because large responses are interrupted by a timeout/deadline set on the connection by the client, or in other cases the socket being simply closed by the client. Sequence of steps to produce the message &quot;http: multiple response.WriteHeader calls&quot; in the logs: 1. Encode() invokes the responseWriter&#39;s Write. This Write first invokes WriteHeader() with code 200 (per go docs) before writing the data on the stream. However while progress ensues in writing the large response, the client closes the connection which interrupts the server. 2. Encode() therefore returns a non-nil error because of the client interruption, and thus invokes WriteHeader() again - this time with the code 500, causing the log message in focus. Since this is an error we can actually ignore, for the client has already closed the connection and doesn&#39;t really care - I recommend we stick to the earlier cover-up fix made here: http://review.couchbase.org/#/c/79272/ In the current commit, I&#39;m just changing the qualifier of &#39;wrote&#39; in CountResponseWriter to public, so that it can be accessed in CBFT where applicable. Change-Id: I</a><a class="double-link" href="https://github.com/couchbase/cbgt/commit/<a class="double-link" href="https://github.com/couchbase/cbgt/commit/e392374d633e6206615012d4770e31be0ba026fa">e392374d6</a>">e392374d6</a><a href="https://github.com/couchbase/cbgt/commit/2aaaf3336fdc4f9c1f91791554b8231fc6196aa3"> Reviewed-on: http://review.couchbase.org/88639 Well-Formed: Build Bot <build@couchbase.com> Reviewed-by: Steve Yen <steve.yen@gmail.com> R... (continued)
7005 of 12818 relevant lines covered (54.65%)
31.62 hits per line
| ID | Job ID | Ran | Files | Coverage | |
|---|---|---|---|---|---|
| 1 | 312.1 | 0 |
54.65 |
Travis Job 312.1 |