On Thu, 18 May 2023 12:32:40 GMT, Andrey Turbanov <[email protected]> wrote:

>> Daniel Fuchs has updated the pull request incrementally with three 
>> additional commits since the last revision:
>> 
>>  - Update 
>> src/java.net.http/share/classes/jdk/internal/net/http/Http1Response.java
>>    
>>    Co-authored-by: Andrey Turbanov <[email protected]>
>>  - Update 
>> src/java.net.http/share/classes/jdk/internal/net/http/ConnectionPool.java
>>    
>>    Co-authored-by: Andrey Turbanov <[email protected]>
>>  - Update test/jdk/java/net/httpclient/AuthFilterCacheTest.java
>>    
>>    Co-authored-by: Andrey Turbanov <[email protected]>
>
> src/java.net.http/share/classes/jdk/internal/net/http/Http1Exchange.java line 
> 72:
> 
>> 70:     /** Records a possible cancellation raised before any operation
>> 71:      * has been initiated, or an error received while sending the 
>> request. */
>> 72:     private AtomicReference<Throwable> failedRef = new 
>> AtomicReference<>();
> 
> Seems it's only modified under lock. Can we use `volatile` instead?

I prefer to keep AtomicReference - it's easier to reason about.
Maybe at some time I'll do a pass to use VarHandles in various places but now 
is not the time.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/14038#discussion_r1197858774

Reply via email to