chan-dx commented on code in PR #4829:
URL: https://github.com/apache/solr/pull/4829#discussion_r3948105197
##########
solr/solrj/src/java/org/apache/solr/client/solrj/SolrClient.java:
##########
@@ -1194,12 +1194,27 @@ public final NamedList<Object> request(final
SolrRequest<?> request)
return request(request, null);
}
+ /**
+ * Whether the failure proves the request never reached the server, making a
replay safe even when
+ * the request isn't idempotent. Only the transport can answer this; the
default is {@code false},
+ * meaning "cannot tell" rather than "the request was sent".
+ */
+ public boolean wasRequestUnsent(Throwable t) {
+ return false;
+ }
+
+ /**
+ * Whether this is a transport-level communication failure rather than a
response from the server.
+ * Implementations must keep {@link #wasRequestUnsent} a subset of this.
+ */
+ public boolean wasCommError(Throwable t) {
+ return false;
+ }
+
Review Comment:
Happy to explain! My understanding is: `wasRequestUnsent` is proof of
non-delivery. `wasCommError` includes `wasRequestUnsent` as one of its causes,
plus the other types listed in `HttpSolrClient`. So `wasCommError` can be true
for a reason that is not proof of non-delivery. For example, `SocketException`,
which can happen right after the server received the request.
Now imagine if we collapsed them into one big `wasCommError`, we'd lose that
distinction. We'd know the socket went wrong, but not whether we have proof the
request never landed, so we wouldn't know whether a replay is safe.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]