On Wed, 28 Oct 2026 18:44:38 GMT, Roland Mesde <[email protected]> wrote:

>> This PR uses a shared per session family depth limit + per session depth 
>> value to enforce invalidation. This will remove the container's 
>> (ConcurrentLinkedQueue) strong references to the child sessions, which 
>> allows child sessions to be garbage collected when they are no longer 
>> reachable. The drawback is that the invalidation depth limit will be per 
>> family, so once a session is invalidated at the specified depth, all deeper 
>> sessions will be invalidated, not just its descendants.
>> 
>> Ran related tests on linux-x64, linux-aarch64, macos-aarch64 and windows-x64:
>> 
>> make test TEST=test/jdk/sun/security/ssl
>> make test TEST=test/jdk/javax/net/ssl
>> 
>> Results:
>> 
>> [windows-x64-specific-test.log](https://github.com/user-attachments/files/33689537/windows-x64-specific-test.log)
>> [windows-x64-specific-2-test.log](https://github.com/user-attachments/files/33689538/windows-x64-specific-2-test.log)
>> [macos-aarch64-specific-test.log](https://github.com/user-attachments/files/33689539/macos-aarch64-specific-test.log)
>> [macos-aarch64-specific-2-test.log](https://github.com/user-attachments/files/33689540/macos-aarch64-specific-2-test.log)
>> [linux-x64-specific-test.log](https://github.com/user-attachments/files/33689541/linux-x64-specific-test.log)
>> [linux-x64-specific-2-test.log](https://github.com/user-attachments/files/33689542/linux-x64-specific-2-test.log)
>> [linux-aarch64-specific-test.log](https://github.com/user-attachments/files/33689543/linux-aarch64-specific-test.log)
>> [linux-aarch64-specific-2-test.log](https://github.com/user-attachments/files/33689544/linux-aarch64-specific-2-test.log)
>> 
>> Low risk - the change is limited to SSLSessionImpl, its cache lookup and the 
>> ticket code. The worst case is an occasional extra full handshake.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Roland Mesde has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Add Comment on Constructor + Family Behavior and Renamed isInvalid() to 
> isInvalidated()

src/java.base/share/classes/sun/security/ssl/SSLSessionImpl.java line 133:

> 131:      * SSLSessionImpl(SSLSessionImpl, SessionId) joins as session to an 
> existing
> 132:      * family. Every other constructor starts a new family at 
> familyDepth 0.
> 133:      */

I find this huge comment hard to read. Let's comment each variable separately 
instead:


    // Shared by all members of a family. Sessions whose familyDepth reaches
    // this limit are invalid. The limit applies to all branches of the family.
    private final AtomicLong familyDepthLimit;

    // This session's depth in its family, set by a copy constructor. Other
    // constructors start a new family at depth 0.
    private final long familyDepth;

    // True once this session has produced a copy, even if that copy is later
    // garbage collected. On invalidation, familyDepthLimit may be lowered
    // only when this flag is true.
    private boolean hasDescendant;

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

PR Review Comment: https://git.openjdk.org/jdk/pull/33447#discussion_r4425523653

Reply via email to