https://dev.arvados.org/https://dev.arvados.org/favicon.ico?15576888422021-06-23T18:09:23ZArvadosArvados - Bug #16665: Keepproxy reports error 413 (entity too large) even if the original error was something elsehttps://dev.arvados.org/issues/16665?journal_id=938962021-06-23T18:09:23ZLucas Di Pentimalucas.dipentima@curii.com
<ul></ul><p>Maybe related to this: <code>go-staticcheck</code> (via vscode) is showing me a warning that says:</p>
<p><code>unreachable case clause: git.arvados.org/arvados.git/sdk/go/keepclient.OversizeBlockError will always match before git.arvados.org/arvados.git/sdk/go/keepclient.InsufficientReplicasError (SA4020)</code></p>
<p>...for the <code>case keepclient.InsufficientReplicasError:</code> in <code>keepproxy.go</code>'s Put() function. Both types are aliases of <code>error</code> so it seems the compiler won't take them as different.</p> Arvados - Bug #16665: Keepproxy reports error 413 (entity too large) even if the original error was something elsehttps://dev.arvados.org/issues/16665?journal_id=938972021-06-23T18:13:57ZPeter Amstutzpeter.amstutz@curii.com
<ul></ul><pre>
type InsufficientReplicasError error
type OversizeBlockError error
switch err.(type) {
case nil:
status = http.StatusOK
_, err = io.WriteString(resp, locatorOut)
case keepclient.OversizeBlockError:
// Too much data
status = http.StatusRequestEntityTooLarge
case keepclient.InsufficientReplicasError:
}
</pre>
<p>I think this is an inconsistency in Go. If you declare a type that is the same as another type, at compile time they will act like different types, but at runtime they will be the same type.</p>
<p>Does this work?</p>
<pre>
type InsufficientReplicasError struct { error }
</pre> Arvados - Bug #16665: Keepproxy reports error 413 (entity too large) even if the original error was something elsehttps://dev.arvados.org/issues/16665?journal_id=938982021-06-23T18:14:07ZPeter Amstutzpeter.amstutz@curii.com
<ul><li><strong>Target version</strong> changed from <i>Arvados Future Sprints</i> to <i>2021-07-21 sprint</i></li></ul> Arvados - Bug #16665: Keepproxy reports error 413 (entity too large) even if the original error was something elsehttps://dev.arvados.org/issues/16665?journal_id=945512021-07-07T16:01:34ZPeter Amstutzpeter.amstutz@curii.com
<ul><li><strong>Target version</strong> changed from <i>2021-07-21 sprint</i> to <i>2021-08-04 sprint</i></li></ul> Arvados - Bug #16665: Keepproxy reports error 413 (entity too large) even if the original error was something elsehttps://dev.arvados.org/issues/16665?journal_id=955132021-07-21T15:31:13ZPeter Amstutzpeter.amstutz@curii.com
<ul><li><strong>Assigned To</strong> set to <i>Lucas Di Pentima</i></li></ul> Arvados - Bug #16665: Keepproxy reports error 413 (entity too large) even if the original error was something elsehttps://dev.arvados.org/issues/16665?journal_id=955542021-07-22T18:38:19ZLucas Di Pentimalucas.dipentima@curii.com
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>In Progress</i></li></ul> Arvados - Bug #16665: Keepproxy reports error 413 (entity too large) even if the original error was something elsehttps://dev.arvados.org/issues/16665?journal_id=955602021-07-22T21:04:42ZLucas Di Pentimalucas.dipentima@curii.com
<ul></ul><p>Updates at <a class="changeset" title="16665: Fixes tests. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima@curii.com>" href="https://dev.arvados.org/projects/arvados/repository/arvados/revisions/e10c23d41a9591830a20171a0f9cb6cfe2921b11">e10c23d41</a> - branch <code>16665-keepproxy-spurious-413-status</code><br />Test run: <a class="external" href="https://ci.arvados.org/job/developer-run-tests/2606/"<a href="https://ci.arvados.org/job/developer-run-tests/2606/">developer-run-tests: #2606 <img src="https://ci.arvados.org/buildStatus/icon?job=developer-run-tests&build=2606" alt="" /></a></a></p>
<ul>
<li>Following Peter's suggestion, updates <code>InsufficientReplicasError</code> & <code>OversizeBlockError</code> error types by wrapping <code>error</code> in a struct, so that the former isn't shadowed by the latter.</li>
<li>Updates tests.</li>
</ul> Arvados - Bug #16665: Keepproxy reports error 413 (entity too large) even if the original error was something elsehttps://dev.arvados.org/issues/16665?journal_id=955942021-07-27T14:11:02ZTom Cleggtom@curii.com
<ul></ul><p>LGTM, thanks.</p>
<p>BTW, about the language issue: error is an interface type, therefore <code>type FooError error</code> defines an interface type, therefore anything that implements the error interface { Error() string } has to match FooError in a type switch. After this fix, <code>type FooError struct { error }</code> is a concrete type, so FooError in a type switch is unambiguous. I think it would have been more normal to use <code>var ErrFoo = errors.New(...)</code> and <code>if err == ErrFoo { ... }</code> for these... oh well.</p> Arvados - Bug #16665: Keepproxy reports error 413 (entity too large) even if the original error was something elsehttps://dev.arvados.org/issues/16665?journal_id=955952021-07-27T15:17:02ZLucas Di Pentimalucas.dipentima@curii.com
<ul><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Resolved</i></li></ul><p>Applied in changeset <a class="changeset" title="Merge branch '16665-keepproxy-spurious-413-status' into main. Closes #16665 Arvados-DCO-1.1-Sign..." href="https://dev.arvados.org/projects/arvados/repository/arvados/revisions/68b9c7d30c7f47f8a9f9cff8a327fa9a3812d4da">arvados|68b9c7d30c7f47f8a9f9cff8a327fa9a3812d4da</a>.</p> Arvados - Bug #16665: Keepproxy reports error 413 (entity too large) even if the original error was something elsehttps://dev.arvados.org/issues/16665?journal_id=985422021-11-16T16:25:47ZPeter Amstutzpeter.amstutz@curii.com
<ul><li><strong>Release</strong> set to <i>42</i></li></ul>