Changeset a65edbef


Ignore:
Timestamp:
May 20, 2014 12:35:48 PM (7 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
06894f9f, d106f48
Parents:
7479aa2
Message:

SSU: Fix peer test deadlock (ticket #1286)

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • history.txt

    r7479aa2 ra65edbef  
     12014-05-20 zzz
     2 * Fixes after code review
     3 * SSU: Fix peer test deadlock (ticket #1286)
     4
    152014-05-15 kytv
    26 * Translations, imported from Transifex:
  • router/java/src/net/i2p/router/RouterVersion.java

    r7479aa2 ra65edbef  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 21;
     21    public final static long BUILD = 22;
    2222
    2323    /** for example "-test" */
  • router/java/src/net/i2p/router/transport/udp/UDPTransport.java

    r7479aa2 ra65edbef  
    1818import java.util.TreeSet;
    1919import java.util.Vector;
     20import java.util.concurrent.atomic.AtomicLong;
    2021import java.util.concurrent.ConcurrentHashMap;
    2122import java.util.concurrent.CopyOnWriteArrayList;
     
    31283129        private boolean _alive;
    31293130        /** when did we last test our reachability */
    3130         private long _lastTested;
     3131        private final AtomicLong _lastTested = new AtomicLong();
    31313132        private boolean _forceRun;
    31323133
     
    31373138        public synchronized void timeReached() {
    31383139            if (shouldTest()) {
    3139                 long sinceRun = _context.clock().now() - _lastTested;
     3140                long sinceRun = _context.clock().now() - _lastTested.get();
    31403141                if ( (_forceRun && sinceRun >= MIN_TEST_FREQUENCY) || (sinceRun >= TEST_FREQUENCY) ) {
    31413142                    locked_runTest();
     
    31543155                    _log.info("Running periodic test with bob = " + bob);
    31553156                _testManager.runTest(bob.getRemoteIPAddress(), bob.getRemotePort(), bob.getCurrentCipherKey(), bob.getCurrentMACKey());
    3156                 _lastTested = _context.clock().now();
     3157                setLastTested();
    31573158                _forceRun = false;
    31583159                return;
     
    31793180         */
    31803181        public synchronized void forceRunImmediately() {
    3181             _lastTested = 0;
     3182            _lastTested.set(0);
    31823183            _forceRun = true;
    31833184            reschedule(5*1000);
     
    31983199         *  @since 0.9.13
    31993200         */
    3200         public synchronized void setLastTested() {
    3201             _lastTested = _context.clock().now();
     3201        public void setLastTested() {
     3202            // do not synchronize - deadlock with PeerTestManager
     3203            _lastTested.set(_context.clock().now());
    32023204        }
    32033205       
Note: See TracChangeset for help on using the changeset viewer.