You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by GitBox <gi...@apache.org> on 2021/06/18 21:09:25 UTC

[GitHub] [httpcomponents-core] carterkozak commented on a change in pull request #293: Fix data race in StrictConnPool

carterkozak commented on a change in pull request #293:
URL: https://github.com/apache/httpcomponents-core/pull/293#discussion_r654106072



##########
File path: httpcore5/src/main/java/org/apache/hc/core5/pool/StrictConnPool.java
##########
@@ -699,14 +699,18 @@ public boolean isDone() {
         }
 
         public void failed(final Exception ex) {
-            if (this.completed.compareAndSet(false, true)) {
-                this.ex = ex;
+            synchronized (this.completed) {

Review comment:
       Perhaps we replace the atomic boolean with an atomic reference to the result/exception, and avoid synchronization?




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org