~pbeaman/akiban-persistit/3.3.1-SNAPSHOT

« back to all changes in this revision

Viewing changes to src/main/java/com/persistit/TransactionIndexBucket.java

merge nwilliams: Fix closing of transactions from threads that have been abandoned.

https://code.launchpad.net/~nwilliams/akiban-persistit/handle-abandoned-txn-status/+merge/149643

Show diffs side-by-side

added added

removed removed

Lines of Context:
258
258
        if (ts >= getFloor()) {
259
259
            for (TransactionStatus s = getCurrent(); s != null; s = s.getNext()) {
260
260
                if (s == status) {
261
 
                    s.complete(timestamp);
262
 
                    status.wwUnlock();
 
261
                    status.completeAndUnlock(timestamp);
263
262
                    if (s.getTs() == getFloor() || hasFloorMoved()) {
264
263
                        reduce();
265
264
                    }
272
271
                if (s == status) {
273
272
                    final TransactionStatus next = s.getNext();
274
273
                    assert s.getTc() != UNCOMMITTED;
275
 
                    s.complete(timestamp);
276
 
                    status.wwUnlock();
 
274
                    status.completeAndUnlock(timestamp);
277
275
                    boolean moved = false;
278
276
                    if (s.getTc() == ABORTED) {
279
277
                        aggregate(s, false);
610
608
         * May be held by another thread briefly while status being checked
611
609
         */
612
610
        assert !status.isHeldByCurrentThread();
613
 
        if (_freeCount < _transactionIndex.getMaxFreeListSize()) {
 
611
        if (_freeCount < _transactionIndex.getMaxFreeListSize() && !status.isAbandoned()) {
614
612
            status.setNext(_free);
615
613
            _free = status;
616
614
            _freeCount++;