Bug 62841 - Refactor DeltaSession locking
Summary: Refactor DeltaSession locking
Alias: None
Product: Tomcat 9
Classification: Unclassified
Component: Cluster (show other bugs)
Version: 9.0.x
Hardware: All All
: P2 enhancement (vote)
Target Milestone: -----
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2018-10-20 10:07 UTC by Mark Thomas
Modified: 2019-05-16 14:28 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Mark Thomas 2018-10-20 10:07:22 UTC
Background: https://tomcat.markmail.org/thread/26rl3hs6wjzf7ssu

It would helpful in some scenarios to reduce the scope of the DeltaSession lock.

Currently the sequence is:
- lock session
- serialize DeltaRequest to message
- recycle DeltaRequest
- unlock session
- send message

The proposed sequence is:
- lock session
- keep reference to populated DeltaRequest
- provide session with new DeltaRequest object
- unlock session
- serialize populated DeltaRequest to message
- send message

To avoid the expense of creating a new DeltaRequest each time, a pool of them could be used which should minimise the garbage.

Looking at the sequence of events, I don't think this does much that is
likely to harm coherence.
Comment 1 Mark Thomas 2019-05-16 14:28:05 UTC
Fixed in:
- master for 9.0.21 onwards
- 8.5.x for 8.5.42 onwards
- 7.0.x for 7.0.95 onwards