Changeset 805979b


Ignore:
Timestamp:
Oct 31, 2015 10:58:51 PM (5 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
b7dc55e3
Parents:
c37cc7a
Message:

UPnP: Fix deadlock in callbacks (ticket #1699)
possibly more to do

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • history.txt

    rc37cc7a r805979b  
     12015-10-31 zzz
     2 * Convert remaining Threads to I2PThread or I2PAppThread
     3 * UPnP: Fix deadlock in callbacks (ticket #1699)
     4
    152015-10-30 zzz
    26 * Router: Fix cascading I2CP error (ticket #1692)
  • router/java/src/net/i2p/router/RouterVersion.java

    rc37cc7a r805979b  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 20;
     21    public final static long BUILD = 21;
    2222
    2323    /** for example "-test" */
  • router/java/src/net/i2p/router/transport/UPnPManager.java

    rc37cc7a r805979b  
    234234            if (_log.shouldLog(Log.DEBUG))
    235235                 _log.debug("UPnP Callback:");
    236 
     236            // Let's not have two of these running at once.
     237            // Deadlock reported in ticket #1699
     238            // and the locking isn't foolproof in UDPTransport.
     239            // UPnP runs the callbacks in a thread, so we can block.
     240            // There is only one UPnPCallback, so lock on this
     241            synchronized(this) {
     242                locked_PFS(statuses);
     243            }
     244        }
     245
     246        private void locked_PFS(Map<ForwardPort,ForwardPortStatus> statuses) {
    237247            byte[] ipaddr = null;
    238248            DetectedIP[] ips = _upnp.getAddress();
     
    245255                        if (!ip.publicAddress.equals(_detectedAddress)) {
    246256                            _detectedAddress = ip.publicAddress;
     257                            // deadlock path 1
    247258                            _manager.externalAddressReceived(SOURCE_UPNP, _detectedAddress.getAddress(), 0);
    248259                        }
     
    270281                    continue;
    271282                boolean success = fps.status >= ForwardPortStatus.MAYBE_SUCCESS;
     283                // deadlock path 2
    272284                _manager.forwardPortStatus(style, ipaddr, fp.portNumber, fps.externalPort, success, fps.reasonString);
    273285            }
  • router/java/src/net/i2p/router/transport/udp/UDPTransport.java

    rc37cc7a r805979b  
    994994                _context.router().saveConfig(changes, null);
    995995            }
     996            // deadlock thru here ticket #1699
    996997            _context.router().rebuildRouterInfo();
    997998        }
     
    21162117     */
    21172118    private RouterAddress getCurrentExternalAddress(boolean isIPv6) {
     2119        // deadlock thru here ticket #1699
    21182120        synchronized (_rebuildLock) {
    21192121            return isIPv6 ? _currentOurV6Address : _currentOurV4Address;
Note: See TracChangeset for help on using the changeset viewer.