Changeset 3fa2fb4


Ignore:
Timestamp:
Nov 11, 2015 1:38:24 PM (5 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
e93e76a
Parents:
ffddf41
Message:

Timers: State fix 4th try (tickets #1694, #1705)
log tweaks

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/util/SimpleTimer2.java

    rffddf41 r3fa2fb4  
    296296                // streaming timers do call with timeoutMs == 0
    297297                if (timeoutMs < 0 && _log.shouldLog(Log.WARN))
    298                     _log.warn("Timeout <= 0: " + this + " timeout = " + timeoutMs + " state: " + _state);
     298                    _log.warn("Sched. timeout <= 0: " + this + " timeout = " + timeoutMs + " state: " + _state);
    299299                timeoutMs = 1; // otherwise we may execute before _future is updated, which is fine
    300300                               // except it triggers 'early execution' warning logging
     
    338338         */
    339339        public synchronized void reschedule(long timeoutMs, boolean useEarliestTime) {
     340            if (timeoutMs <= 0) {
     341                if (timeoutMs < 0 && _log.shouldWarn())
     342                    _log.warn("Resched. timeout < 0: " + this + " timeout = " + timeoutMs + " state: " + _state);
     343                timeoutMs = 1;
     344            }
    340345            final long now = System.currentTimeMillis();
    341346            long oldTimeout;
     
    350355                (oldTimeout + _fuzz < timeoutMs && !useEarliestTime)||
    351356                (!scheduled)) {
     357                if (scheduled && oldTimeout <= 5) {
     358                    // don't reschedule to avoid race
     359                    if (_log.shouldWarn())
     360                        _log.warn("not rescheduling to " + timeoutMs + ", about to execute " + this + " in " + oldTimeout);
     361                    return;
     362                }
    352363                if (scheduled && (now + timeoutMs) < _nextRun) {
    353364                    if (_log.shouldLog(Log.INFO))
     
    383394                return true;
    384395              case SCHEDULED:
     396                // There's probably a race here, where it's cancelled after it's running
     397                // The result (if rescheduled) is a dup on the queue, see tickets 1694, 1705
     398                // Mitigated by close-to-execution check in reschedule()
    385399                boolean cancelled = _future.cancel(false);
    386400                if (cancelled)
    387401                    _state = TimedEventState.CANCELLED;
    388                 else 
    389                     _log.warn("could not cancel "+this);
     402                else
     403                    _log.error("could not cancel " + this + " to run in " + (_nextRun - System.currentTimeMillis()), new Exception());
    390404                return cancelled;
    391405            }
  • history.txt

    rffddf41 r3fa2fb4  
     12015-11-11 zzz
     2 * i2psnark:
     3   - Change log level to hide socket closed error at tunnel shutdown
     4   - Increase max pieces
     5 * Timers: State fix 4th try (tickets #1694, #1705)
     6
    172015-11-05 zzz
    28 * I2CP: Fix additional connections getting rejected during tunnel open (ticket #1650)
  • router/java/src/net/i2p/router/RouterVersion.java

    rffddf41 r3fa2fb4  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 24;
     21    public final static long BUILD = 25;
    2222
    2323    /** for example "-test" */
Note: See TracChangeset for help on using the changeset viewer.