Changes between Initial Version and Version 15 of Ticket #4216


Ignore:
Timestamp:
2012-03-11T20:04:26+01:00 (13 years ago)
Author:
simon04
Comment:

From #5369:


To reproduce:

  1. Run a TCP server that never handles incoming connections, e.g. in Python:
    import SocketServer, time
    
    class ForeverHandler(SocketServer.BaseRequestHandler):
        def handle(self):
            time.sleep(10000)
    
    if __name__ == "__main__":
        HOST, PORT = "localhost", 9996
        server = SocketServer.TCPServer((HOST, PORT), ForeverHandler)
        server.serve_forever()
    
  2. Change the OSM server URL in JOSM to http://localhost.com:9996/api
  3. Do anything involving the API (e.g., download an bbox or fetch the history of an object)
  4. Try to cancel the operation – fail.

The connection hangs somewhere inside Java's AbstractPlainSocketImpl, thus hard to change. I see the following two possibilities:

  1. Switch to Apache's HttpClient library
  2. Perform OsmConnections in separate Threads, but how to reliably kill the thread (see http://docs.oracle.com/javase/1.5.0/docs/guide/misc/threadPrimitiveDeprecation.html)

What do you think?

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #4216

    • Property Priority normalmajor
    • Property Keywords r-2010-02 added
    • Property Summary No timeout on API capabilities call, JOSM hangsAPI calls blocking, cancel not working, JOSM hangs