Modify

Opened 12 years ago

Closed 9 years ago

Last modified 9 years ago

#7813 closed defect (fixed)

[Patch] JOSM often fails to download, and I cannot Cancel

Reported by: anonymous Owned by: team
Priority: major Milestone: 15.08
Component: Core Version: latest
Keywords: josm download cancel Cc: jens@…, midibase@…, javnik36@…

Description

When I try to Download from OSM, the process usually gets stuck at 16KB or 23KB. It goes for about a minute without downloading anything. Then, when I press Cancel, the program hangs up, I have to kill JOSM from Task Manager. This happens very frequently, I can say most of the time, but not always.

Version: 5210
OS: Windows

Attachments (3)

stacktrace1.txt (47.9 KB ) - added by anirud 9 years ago.
stacktrace2.txt (50.7 KB ) - added by anirud 9 years ago.
OsmServerReader.java.patch (916 bytes ) - added by anirud 9 years ago.
patch to honor socket.timeout.read setting

Download all attachments as: .zip

Change History (53)

comment:1 by skyper, 12 years ago

Owner: changed from team to anonymous
Status: newneedinfo

First of all, please try to update JOSM.

We need more information.

  • When reporting a bug, please include the first three blocks of the status report (Help -> Show status report).
  • Did you try it with an empty/new preference directory (Reset preferences) ?
  • Does it happen everywhere or only in a certain region ?
    • Please tell us the region where it happens.

Thanks

comment:2 by anonymous, 12 years ago

Hi,
I updated JOSM to latest a few days ago.

Status report:

Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2012-06-04 01:31:02
Last Changed Author: simon04
Revision: 5267
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2012-06-03 22:21:06 +0200 (Sun, 03 Jun 2012)
Last Changed Rev: 5267

Identification: JOSM/1.5 (5267 en)
Memory Usage: 47 MB / 494 MB (25 MB allocated, but free)
Java version: 1.7.0_05, Oracle Corporation, Java HotSpot(TM) Client VM
Operating system: Windows 7

Plugin: openstreetbugs (28412)
Plugin: turnrestrictions (28412)

I cleared the preferences and the problem still persists. It is not sensitive to the area.

Last edited 12 years ago by Don-vip (previous) (diff)

in reply to:  2 comment:3 by anonymous, 12 years ago

+ I would like to add that I only tried to download Hungarian areas (all of which were quite small, so that should not be a problem). So it _might_ be sensitive to the area somehow, I can only say for sure that Hungarian areas fail to download for me, most of the time.

Replying to anonymous:

It is not sensitive to the area.

comment:4 by Don-vip, 12 years ago

Ticket #7832 has been marked as a duplicate of this ticket.

comment:5 by Don-vip, 12 years ago

Cc: jens@… added

comment:6 by Don-vip, 12 years ago

Ticket #7875 has been marked as a duplicate of this ticket.

comment:7 by Don-vip, 12 years ago

Owner: changed from anonymous to team
Status: needinfonew

comment:8 by Don-vip, 12 years ago

Cc: midibase@… added

comment:9 by anonymous, 12 years ago

Ticket #7900 has been marked as a duplicate of this ticket.

comment:10 by Don-vip, 12 years ago

Cc: javnik36@… added

comment:11 by Don-vip, 12 years ago

Priority: normalmajor

We have now 4 people complaining about this, and not a clue :(

comment:12 by javnik36@…, 12 years ago

Hi!
I want to repair my Josm and so i have done:
I went to the josm.exe properties then I have enabled compatibility mode with Win XP SP3 and apply. I run the Josm...and it works! JOSM normally download the OSM data, but why.....here is the question ;)


Maybe this helps...? (Sorry for my English :)

comment:13 by anonymous, 12 years ago

Latest josm-tested works perfectly with JRE6.0.33 but the bug appears with JRE7.0.5.
Tested with Windows 7 SP1 and JRE x64 JVMs.

in reply to:  13 ; comment:14 by Don-vip, 12 years ago

Replying to anonymous:

the bug appears with JRE7.0.5.

Interesting. I see Java 7 update 4 introduced several huge changes (new JVM, GC, etc.). Is it possible for you to test with JRE7u3 ?

in reply to:  14 comment:15 by anonymous, 12 years ago

Replying to Don-vip:

Interesting. I see Java 7 update 4 introduced several huge changes (new JVM, GC, etc.). Is it possible for you to test with JRE7u3 ?

Tested with JRE7u3 and the new JRE7u6: same behaviour.

comment:16 by Don-vip, 12 years ago

Ticket #8000 has been marked as a duplicate of this ticket.

comment:17 by javnik36@…, 12 years ago

I have tested with new JOSM 5482 and new JRE7u7 and still the same behaviuor...

comment:18 by Witte22, 12 years ago

I am trying to get JOSM working to change items in my direct neighborhood. Downloading isn't working and I will get the same situation as described in this ticket. Downloading stops at 16kB and the only thing to do is kill the JOSM application with the task manager.
Hoping a solution/workaround is availabel soon

in reply to:  18 comment:19 by skyper, 12 years ago

Replying to Witte22:

Hoping a solution/workaround is availabel soon.

As already mentioned a workaround is to use java 6 instead of java 7

EDT: or try comment:12

Last edited 11 years ago by skyper (previous) (diff)

comment:20 by heatherkcowley@…, 11 years ago

I went to State of the Map last weekend in Portland, so I'm excited to start working in OSM. I downloaded the jar file as indicated http://wiki.openstreetmap.org/wiki/JOSM/Guide and then tried to start on a little tiny town in the US, and I hang up exactly as described above. Help! I am completely new to OSM and JOSM.

in reply to:  20 ; comment:21 by skyper, 11 years ago

Replying to heatherkcowley@…:

I went to State of the Map last weekend in Portland, so I'm excited to start working in OSM. I downloaded the jar file as indicated http://wiki.openstreetmap.org/wiki/JOSM/Guide and then tried to start on a little tiny town in the US, and I hang up exactly as described above. Help! I am completely new to OSM and JOSM.

Hi
Welcom to OSM !

This seems to be a problem with java 7 on windows. One solution is to use java 6. This has nothing to do with OSM and only little with JOSM.

Anyway, you probably get more help on the newbie mailing list or in the forum. This ticket system is definitly the wrong place to ask for help.

Cheers

in reply to:  21 ; comment:22 by heatherkcowley@…, 11 years ago

Replying to skyper:

Replying to heatherkcowley@…:

I went to State of the Map last weekend in Portland, so I'm excited to start working in OSM. I downloaded the jar file as indicated http://wiki.openstreetmap.org/wiki/JOSM/Guide and then tried to start on a little tiny town in the US, and I hang up exactly as described above. Help! I am completely new to OSM and JOSM.

Hi
Welcom to OSM !

This seems to be a problem with java 7 on windows. One solution is to use java 6. This has nothing to do with OSM and only little with JOSM.

Anyway, you probably get more help on the newbie mailing list or in the forum. This ticket system is definitly the wrong place to ask for help.

Cheers

Where is the "Newbie mailing list" or the "forum"? I can't get JOSM to work, so I googled my problem and it matches this thread, so I don't understand the boot.

in reply to:  22 comment:23 by skyper, 11 years ago

Replying to heatherkcowley@…:

Sorry, I did not intend to offend you but only was trying to give you a hint as this ticket is open for some time now and the problem is not found, yet. You are welcome to comment on tickets.

Where is the "Newbie mailing list" or the "forum"? I can't get JOSM to work, so I googled my problem and it matches this thread, so I don't understand the boot.

Have a look at the main page.

comment:24 by rickmastfan67, 11 years ago

Maybe this bug has to deal with the 32-bit version of Java. I'm personally using the 64-bit and have had non of these downloading problems. So, if these people are using Windows 7 x64, they should install the x64 version of Java 7 to use with JOSM. It might fix their problems.

Too bad the "Operating system" line in the Status Report area doesn't list which version of Windows 7 they are running (x86 or x64). I wonder if that can be improved possibility in JOSM?

Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2013-01-30 02:31:37
Last Changed Author: Don-vip
Revision: 5692
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2013-01-30 02:25:13 +0100 (Wed, 30 Jan 2013)
Last Changed Rev: 5692

Identification: JOSM/1.5 (5692 en)
Memory Usage: 154 MB / 2730 MB (77 MB allocated, but free)
Java version: 1.7.0_11, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Operating system: Windows 7

Plugin: OpeningHoursEditor (29210)
Plugin: buildings_tools (29210)
Plugin: mapdust (29210)
Plugin: measurement (29210)
Plugin: mirrored_download (29210)
Plugin: openstreetbugs (29210)
Plugin: reverter (29216)
Plugin: turnrestrictions (29210)
Plugin: undelete (29210)
Plugin: utilsplugin2 (29210)

comment:25 by sammuell, 11 years ago

Version: latesttested

comment:26 by sammuell, 11 years ago

Correct submission error

comment:27 by sammuell, 11 years ago

Version: testedlatest

Revert last edit. Wrong ticket, sorry.

Last edited 11 years ago by sammuell (previous) (diff)

comment:28 by brussell237@…, 11 years ago

Report same issue with Windows 7. Australia and latest version 6238. Never have had this issue before.

comment:29 by skyper, 10 years ago

Also a problem on Linux with the history dialog when downloading the history, see skyper

Version 0, edited 10 years ago by skyper (next)

comment:30 by anirud, 9 years ago

I still have the problem. For me, the problem happens at around 10% of downloads. It's very annoying.

I did a thread dump when it happens and think it is caused by the OSM servers. See attached stacktraces:

  • stacktrace1.txt: after the download stops progressing. Notice the thread pool-1-thread-1, which is stuck at java.net.SocketInputStream.socketRead0
  • stacktrace2.txt: after I click "Cancel": now the AWT-EventQueue-0 thread is waiting to lock 0x066f8da0, which is held by the pool-1-thread-1 thread.

The probable culprit is, that the ChunkedInputStream.close() method is synchronized and is waiting for the sockretRead to complete, but it never does (or maybe after very long time). If you closed the SSLSocket instead, the Cancel functionality might work.

Another question is whether the OSM servers really fail that often. Maybe the problem is somewhere else, for example by trying to read after there are no more data in the socket. It would be worthwhile to look into the server logs. For example, I did following request today, that hung, no more than few minutes before 2015-05-05 05:23:27 GMT:

GET https://api.openstreetmap.org/api/0.6/map?bbox=17.8847122,48.7492849,17.892437,48.7721432

Hope this will help. Just a note, I'm using Windows 7, Java HotSpot SE Runtime Environment (build 1.8.0_40-b26) and latest JOSM.

Last edited 9 years ago by anirud (previous) (diff)

by anirud, 9 years ago

Attachment: stacktrace1.txt added

by anirud, 9 years ago

Attachment: stacktrace2.txt added

comment:31 by anirud, 9 years ago

I investigated the problem further. The Socket is internal to the HttpURLConnection, so you cannot close it. I reported a bug to the JDK.

Workaround could be to use a short timeout and just ignore the timeout exception and start the read again. This will make the cancel button work. I will investigate this possibility.

Last edited 9 years ago by anirud (previous) (diff)

comment:32 by anirud, 9 years ago

This is not easily possible, as the stream is read directly by the XML parser. Maybe we should be able to set timeout to about 20 seconds and if the OSM server stops sending data, we will wait and the download will fail. Or we should try to use third party library, such as apache HttpClient, but first we have to test if it does not have similar issue.

in reply to:  31 comment:33 by Don-vip, 9 years ago

Replying to anirud:

I reported a bug to the JDK.

Thanks :) Can you please share the incident number here? (JI-XXXX)

comment:34 by anonymous, 9 years ago

It is JI-9021192, but AFAIK it's not to be found on the internet until it's approved under different number

comment:35 by anirud, 9 years ago

Yesterday I got response from Oracle to the bug. It was someone with an Indian name and he asked for a test case, which I of course sent in the original report. This is my second bug to JDK and with same result. I think it is vain to wait for oracle.

I see two options now:

  1. implement timeout: JOSM will not hang forever, only for the duration of the timeout.
  1. use Apache HttpClient instead of java.net.HttpUrlConnection: I just tested cancelling from other another thread works.
Last edited 9 years ago by anirud (previous) (diff)

comment:36 by anirud, 9 years ago

I found out the timeout setting is already present under the key "socket.timeout.read" and "socket.timeout.connect", but it is not always honored. I will attach a patch to honor it during download. I tested it, and when the download hangs, it will fail with "read timed out". Then I just retry and it's ok. By the way, there are other places where setupURLConnection is not called after openHttpConnection.

by anirud, 9 years ago

Attachment: OsmServerReader.java.patch added

patch to honor socket.timeout.read setting

comment:37 by Don-vip, 9 years ago

For reference: javabug:8081395
It's a shame how your bug report has been treated. I had some similar experience with the same person. It's usually better when American or Russian employees actually investigate the bug... We'll see to include your patch, thanks :)

comment:38 by Don-vip, 9 years ago

Milestone: 15.06
Summary: JOSM often fails to download, and I cannot Cancel[Patch] JOSM often fails to download, and I cannot Cancel

comment:39 by anonymous, 9 years ago

How did you find that bug? I wasn't notified of it. Yes, that's my report.

That Pardeep Sharma was also assigned to my first JDK-bug, which was trivial to fix, and is not fixed until today and asked for test case, which was just one line of code :). They should fire him...

comment:40 by stoecker, 9 years ago

Closing this bug report as incomplete is not only a shame, but bloody brain damaged.

comment:41 by stoecker, 9 years ago

Is there a quality management for openJDK? For openSUSE when you got treated this way you could escalate a bug report into the quality management and somebody else reviewed if the bug handling person was doing right.

comment:42 by anirud, 9 years ago

I don't know. I tried to contact Pardeep by email once more and asked him to reopen it.

in reply to:  39 comment:43 by Don-vip, 9 years ago

Replying to anonymous:

How did you find that bug?

With the incident number you gave me :) Try this url: https://bugs.openjdk.java.net/browse/JI-9021192

in reply to:  41 comment:44 by Don-vip, 9 years ago

Replying to stoecker:

Is there a quality management for openJDK? For openSUSE when you got treated this way you could escalate a bug report into the quality management and somebody else reviewed if the bug handling person was doing right.

This page details the life cycle of openjdk bugs. Incomplete basically means "not enough data to investigate", which is a pure joke in this case. At the end is said:

General questions about JBS can be sent to discuss@….

We should send a mail before the bug is closed.

comment:45 by anirud, 9 years ago

Pardeep replied to my e-mail, he does not know to run the servlet, I'll try to help him.

comment:46 by anirud, 9 years ago

The JDK bug is reopened :). I'm curious if they'll ever fix it...

comment:47 by Don-vip, 9 years ago

Milestone: 15.0615.07

skip milestone 15.06

comment:48 by anirud, 9 years ago

This one is a duplicate of this, marked as fixed but not actually fixed: https://josm.openstreetmap.de/ticket/4216... Do you plan to apply my patch?

comment:49 by Don-vip, 9 years ago

Resolution: fixed
Status: newclosed

In 8563/josm:

fix #7813 - proper timeouts when connecting to OSM server (patch by anirud)

comment:50 by Don-vip, 9 years ago

Milestone: 15.0715.08

Milestone renamed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.