https://dev.arvados.org/https://dev.arvados.org/favicon.ico?15576888422017-04-24T14:27:21ZArvadosArvados - Bug #11537: [keepproxy] detect proxy loop (broken config) -- return an error if keepproxy receives a request from itselfhttps://dev.arvados.org/issues/11537?journal_id=509672017-04-24T14:27:21ZTom Cleggtom@curii.com
<ul><li><strong>Subject</strong> changed from <i>[keepproxy] return an error if keepproxy receives a request from itself</i> to <i>[keepproxy] detect proxy loop (broken config) -- return an error if keepproxy receives a request from itself</i></li></ul> Arvados - Bug #11537: [keepproxy] detect proxy loop (broken config) -- return an error if keepproxy receives a request from itselfhttps://dev.arvados.org/issues/11537?journal_id=510222017-04-25T18:57:01ZTom Morristfmorris@veritasgenetics.com
<ul><li><strong>Target version</strong> set to <i>2017-05-10 sprint</i></li><li><strong>Story points</strong> set to <i>1.0</i></li></ul> Arvados - Bug #11537: [keepproxy] detect proxy loop (broken config) -- return an error if keepproxy receives a request from itselfhttps://dev.arvados.org/issues/11537?journal_id=511762017-04-26T19:38:22ZTom Cleggtom@curii.com
<ul><li><strong>Assigned To</strong> set to <i>Tom Clegg</i></li></ul> Arvados - Bug #11537: [keepproxy] detect proxy loop (broken config) -- return an error if keepproxy receives a request from itselfhttps://dev.arvados.org/issues/11537?journal_id=512022017-04-26T20:51:24ZTom Cleggtom@curii.com
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>In Progress</i></li></ul> Arvados - Bug #11537: [keepproxy] detect proxy loop (broken config) -- return an error if keepproxy receives a request from itselfhttps://dev.arvados.org/issues/11537?journal_id=512312017-04-27T19:29:51ZTom Cleggtom@curii.com
<ul></ul>Implementation:
<ul>
<li>Instead of adding a Do field to keepclient.KeepClient as described, I changed the Client field's type from *http.Client to a HTTPClient interface. Otherwise, using the Do field would make the Client field meaningless, except that the "set appropriate timeout according to proxy/disk services" code would edit it uselessly.</li>
<li>In order to make the "loop detected" error visible to the outer keepproxy on writes, I had to adjust the keepclient error handling. Now, instead of just returning a generic "insufficient replicas" error object, it returns the errors returned by the backend servers, like we do for reads. I also updated the error identifiers to match Go conventions ("FooError" is a type, and "ErrFoo" is an object).</li>
</ul>
Functional:
<ul>
<li>Requests initiated by keepproxy have a "Via: HTTP/1.1 keepproxy" header where HTTP/1.1 is the protocol of the original request.</li>
<li>Responses returned by keepproxy have a "Via: HTTP/1.1 keepproxy" header. It's possible the actual upstream protocol (between keepproxy and keepstore) is HTTP/2 but this distinction isn't exposed by the keepclient interface, and seems unimportant anyway.</li>
<li>When a loop is detected, the client receives a 500 response and the server log says: <pre>
2017/04/27 15:24:49 proxy loop detected (request has Via: "HTTP/1.1 keepproxy"): perhaps keepproxy is misidentified by gateway config as an external client, or its keep_services record does not have service_type=proxy?
</pre></li>
</ul>
<p>11537-keepproxy-loop @ <a class="changeset" title="11537: Add Via header to get/head/post/put responses." href="https://dev.arvados.org/projects/arvados/repository/arvados/revisions/baa1c3db1f635828dda3cebdc47d98b33bb6518d">baa1c3db1f635828dda3cebdc47d98b33bb6518d</a></p> Arvados - Bug #11537: [keepproxy] detect proxy loop (broken config) -- return an error if keepproxy receives a request from itselfhttps://dev.arvados.org/issues/11537?journal_id=512642017-04-28T16:46:14ZRadhika Chippadaradhika@curoverse.com
<ul></ul><p>11537-keepproxy-loop LGTM</p> Arvados - Bug #11537: [keepproxy] detect proxy loop (broken config) -- return an error if keepproxy receives a request from itselfhttps://dev.arvados.org/issues/11537?journal_id=512662017-04-28T17:05:06ZTom Cleggtom@curii.com
<ul><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Resolved</i></li></ul><p>Applied in changeset arvados|commit:e56ae6aad06c37d5512537047871d7363dd97620.</p>