summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
705a9ef)
For the RO tx PhantomReference cleanup mechanism, modified
RemoteTransactionContextSupport to pass the front-end client
TransactionProxy instance as the referent to the
FinalizablePhantomReference. Previously we were passing the
RemoteTransactionContextSupport instance which is only reachable via
a hard reference until the primary shard actor is obtained and thus may
be eligible for GC while the TransactionProxy is still in use.
Change-Id: Ib2808b4ba8113a5722f9ee422434a89adaf775fe
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
transactionActor, getActorContext(), remoteTransactionVersion, transactionContextWrapper.getLimiter());
if(parent.getType() == TransactionType.READ_ONLY) {
transactionActor, getActorContext(), remoteTransactionVersion, transactionContextWrapper.getLimiter());
if(parent.getType() == TransactionType.READ_ONLY) {
- TransactionContextCleanup.track(this, ret);
+ TransactionContextCleanup.track(parent, ret);
* to the old generation space and thus should be cleaned up in a timely manner as the GC
* runs on the young generation (eden, swap1...) space much more frequently.
*/
* to the old generation space and thus should be cleaned up in a timely manner as the GC
* runs on the young generation (eden, swap1...) space much more frequently.
*/
-final class TransactionContextCleanup extends FinalizablePhantomReference<RemoteTransactionContextSupport> {
+final class TransactionContextCleanup extends FinalizablePhantomReference<TransactionProxy> {
private static final Logger LOG = LoggerFactory.getLogger(TransactionContextCleanup.class);
/**
* Used to enqueue the PhantomReferences for read-only TransactionProxy instances. The
private static final Logger LOG = LoggerFactory.getLogger(TransactionContextCleanup.class);
/**
* Used to enqueue the PhantomReferences for read-only TransactionProxy instances. The
private final TransactionContext cleanup;
private final TransactionContext cleanup;
- private TransactionContextCleanup(RemoteTransactionContextSupport referent, TransactionContext cleanup) {
+ private TransactionContextCleanup(TransactionProxy referent, TransactionContext cleanup) {
super(referent, QUEUE);
this.cleanup = cleanup;
}
super(referent, QUEUE);
this.cleanup = cleanup;
}
- static void track(final RemoteTransactionContextSupport referent, final TransactionContext cleanup) {
+ static void track(final TransactionProxy referent, final TransactionContext cleanup) {
final TransactionContextCleanup ret = new TransactionContextCleanup(referent, cleanup);
CACHE.put(cleanup, ret);
}
final TransactionContextCleanup ret = new TransactionContextCleanup(referent, cleanup);
CACHE.put(cleanup, ret);
}
- static void untrack(final RemoteTransactionContext cleanup) {
+ static void untrack(final TransactionContext cleanup) {
CACHE.remove(cleanup);
}
}
\ No newline at end of file
CACHE.remove(cleanup);
}
}
\ No newline at end of file