Changeset 63958df


Ignore:
Timestamp:
Sep 4, 2011 8:26:47 PM (9 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
2c502c5
Parents:
42fc22e
Message:
  • NetDB: Try again to fix ISJ deadlock, thx devzero
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • history.txt

    r42fc22e r63958df  
     12011-09-04 zzz
     2  * NetDB: Try again to fix ISJ deadlock, thx devzero
     3  * Transport: Remove one global lock in OutboundMessageRegistry.
     4
    152011-09-03 zzz
    26  * i2psnark: Fix "eject" button in certain browsers (ticket #511)
    37  * UDP Inbound:
    4     - Hopefully fix race NPE, thx dream
     8    - Hopefully fix race NPE, thx devzero
    59    - Catch some more fragment errors
    610    - Exception and log tweaks
     
    9132011-09-02 zzz
    1014  * Console: Cache user-agent processing
    11   * NetDB: Hopefully fix ISJ deadlock, thx dream
     15  * NetDB: Hopefully fix ISJ deadlock, thx devzero
    1216
    13172011-09-02 sponge
  • router/java/src/net/i2p/router/MessageSelector.java

    r42fc22e r63958df  
    2323     * will be run for every OutNetMessage associated with this selector
    2424     * (by InNetMessagePool), after calling setMessage() for that ReplyJob.
     25     *
     26     * WARNING this is called from within OutboundMessageSelector.getOriginalMessages()
     27     * inside a lock and can lead to deadlocks if the selector does too much in isMatch().
     28     * Until the lock is removed, take care to keep it simple.
     29     *
    2530     */
    2631    public boolean isMatch(I2NPMessage message);
  • router/java/src/net/i2p/router/RouterVersion.java

    r42fc22e r63958df  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 10;
     21    public final static long BUILD = 11;
    2222
    2323    /** for example "-test" */
  • router/java/src/net/i2p/router/networkdb/kademlia/IterativeLookupSelector.java

    r42fc22e r63958df  
    22
    33import net.i2p.data.Hash;
    4 import net.i2p.data.RouterInfo;
    54import net.i2p.data.i2np.DatabaseSearchReplyMessage;
    65import net.i2p.data.i2np.DatabaseStoreMessage;
     
    1110
    1211/**
    13  *  Slightly modified version of FloodOnlyLookupSelector,
    14  *  plus it incorporates the functions of SingleLookupJob inline.
     12 *  Slightly modified version of FloodOnlyLookupSelector.
    1513 *  Always follows the DSRM entries.
    1614 *
     
    5149            DatabaseSearchReplyMessage dsrm = (DatabaseSearchReplyMessage)message;
    5250            if (_search.getKey().equals(dsrm.getSearchKey())) {
    53 
    54                 // TODO - dsrm.getFromHash() can't be trusted - check against the list of
    55                 // those we sent the search to in _search ?
    56                 Hash from = dsrm.getFromHash();
    57 
    58                 // Moved from FloodOnlyLookupMatchJob so it is called for all replies
    59                 // rather than just the last one
    6051                // Got a netDb reply pointing us at other floodfills...
    61                 if (_log.shouldLog(Log.INFO))
    62                     _log.info(_search.getJobId() + ": Processing DSRM via IterativeLookupJobs, apparently from " + from);
    63 
    64                 // Chase the hashes from the reply
    65                 // 255 max, see comments in SingleLookupJob
    66                 int limit = Math.min(dsrm.getNumReplies(), SingleLookupJob.MAX_TO_FOLLOW);
    67                 int newPeers = 0;
    68                 int oldPeers = 0;
    69                 int invalidPeers = 0;
    70                 for (int i = 0; i < limit; i++) {
    71                     Hash peer = dsrm.getReply(i);
    72                     if (peer.equals(_context.routerHash())) {
    73                         // us
    74                         oldPeers++;
    75                         continue;
    76                     }
    77                     if (peer.equals(from)) {
    78                         // wtf
    79                         invalidPeers++;
    80                         continue;
    81                     }
    82                     RouterInfo ri = _context.netDb().lookupRouterInfoLocally(peer);
    83                     if (ri == null) {
    84                         // get the RI from the peer that told us about it
    85                         _context.jobQueue().addJob(new IterativeFollowupJob(_context, peer, from, _search));
    86                         newPeers++;
    87                     } else if (ri.getPublished() < _context.clock().now() - 60*60*1000 ||
    88                              !FloodfillNetworkDatabaseFacade.isFloodfill(ri)) {
    89                         // get an updated RI from the (now ff?) peer
    90                         _context.jobQueue().addJob(new IterativeFollowupJob(_context, peer, peer, _search));
    91                         oldPeers++;
    92                     } else {
    93                         // add it to the sorted queue
    94                         // this will check if we have already tried it
    95                         // should we really add? if we know about it but skipped it,
    96                         // it was for some reason?
    97                         _search.newPeerToTry(peer);
    98                         oldPeers++;
    99                     }
    100                 }
    101                 long timeSent = _search.timeSent(from);
    102                 // assume 0 dup
    103                 if (timeSent > 0) {
    104                     _context.profileManager().dbLookupReply(from,  newPeers, oldPeers, invalidPeers, 0,
    105                                                             _context.clock().now() - timeSent);
     52                if (_log.shouldLog(Log.INFO)) {
     53                    Hash from = dsrm.getFromHash();
     54                    _log.info(_search.getJobId() + ": Processing DSRM via IterativeLookupJob, apparently from " + from);
    10655                }
    10756
    108                 _search.failed(dsrm.getFromHash(), false);
     57                // was inline, now in IterativeLookupJob due to deadlocks
     58                _context.jobQueue().addJob(new IterativeLookupJob(_context, dsrm, _search));
     59
    10960                // fall through, always return false, we do not wish the match job to be called
    11061            }
Note: See TracChangeset for help on using the changeset viewer.