Ignore:
Timestamp:
2026-12-02T22:48:39+01:00 (less than one hour ago)
Author:
stoecker
Message:

fix #25150 - patch by VeeBack02 - an idle connection blocks all other requests, use order lock after request parsing - see #23821

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java

    r19711 r19726  
    197197    @Override
    198198    public void run() {
    199         // The locks ensure that we process the instructions in the order in which they came.
    200         // This is mostly important when the caller is attempting to create a new layer and add multiple download
    201         // instructions for that layer. See #23821 for additional details.
    202         ORDER_LOCK.lock();
    203199        try (request;
    204200             Writer out = new OutputStreamWriter(new BufferedOutputStream(request.getOutputStream()), RESPONSE_CHARSET);
    … …  
    207203        } catch (IOException ioe) {
    208204            Logging.debug(Logging.getErrorMessage(ioe));
    209         } finally {
    210             ORDER_LOCK.unlock();
    211205        }
    212206    }
    … …  
    251245            final Map<String, String> headers = parseHeaders(in);
    252246            final String sender = parseSender(headers, request);
    253             callHandler(url, command, out, sender);
     247            // The lock ensures that we process the instructions in the order in which they came.
     248            // This is mostly important when the caller is attempting to create a new layer and add multiple download
     249            // instructions for that layer. See #23821 for additional details.
     250            // It must only be taken once the request has been read. Otherwise a client that opens a connection without
     251            // sending anything (e.g. a browser preconnect) blocks every other remote control request until it gives up.
     252            ORDER_LOCK.lock();
     253            try {
     254                callHandler(url, command, out, sender);
     255            } finally {
     256                ORDER_LOCK.unlock();
     257            }
    254258        } catch (ReflectiveOperationException e) {
    255259            Logging.error(e);
Note: See TracChangeset for help on using the changeset viewer.