Opened 7 years ago
Last modified 7 years ago
#16408 new enhancement
JOSM is reloading multiple times a modified validation file
Reported by: | naoliv | Owned by: | team |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | Core | Version: | |
Keywords: | reload file watch event | Cc: |
Description
It seems that #15282 is back.
While saving a local validation file I can see that JOSM is reloading it 3 times:
2018-06-20 08:19:27.182 INFO: Source Brasil has been modified. Reloading it... 2018-06-20 08:19:27.222 INFO: Source Brasil has been modified. Reloading it... 2018-06-20 08:19:27.244 INFO: Source Brasil has been modified. Reloading it...
JOSM:
Relative:URL: ^/trunk Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b Last:Changed Date: 2018-06-19 19:44:45 +0200 (Tue, 19 Jun 2018) Revision:13959 Build-Date:2018-06-19 17:47:20 URL:https://josm.openstreetmap.de/svn/trunk Identification: JOSM/1.5 (13959 en) Linux Debian GNU/Linux testing (buster) Memory Usage: 871 MB / 7168 MB (690 MB allocated, but free) Java version: 10.0.1+10-Debian-4, Oracle Corporation, OpenJDK 64-Bit Server VM Screen: :0.0 1600x900, :0.1 1280x1024 Maximum Screen Size: 1600x1024 Java package: openjdk-10-jre:amd64-10.0.1+10-4 Java ATK Wrapper package: libatk-wrapper-java:all-0.33.3-21 VM arguments: [--add-modules=java.activation,java.se.ee, -Dawt.useSystemAAFontSettings=gasp] Program arguments: [--language=en] Dataset consistency test: No problems found
Attachments (0)
Change History (9)
comment:1 by , 7 years ago
comment:2 by , 7 years ago
Sure, I will see if I can test it using a live CD of another distro.
But doing some more tests:
- With a simple
touch
I can see that JOSM only reloads it a single time2018-06-20 14:11:50.482 INFO: Source Brasil has been modified. Reloading it...
- Only opening the file for edition (without editing or saving it) I see 3 events:
2018-06-20 14:13:21.537 FINE: Received ENTRY_CREATE event for unregistered file: /arquivos/git/validador-josm/.Rules_Brazilian-Specific.validator.mapcss.swp 2018-06-20 14:13:21.538 FINE: Received ENTRY_CREATE event for unregistered file: /arquivos/git/validador-josm/.Rules_Brazilian-Specific.validator.mapcss.swp 2018-06-20 14:13:21.538 FINE: Received ENTRY_MODIFY event for unregistered file: /arquivos/git/validador-josm/.Rules_Brazilian-Specific.validator.mapcss.swp
- Saving the file (without closing it):
2018-06-20 14:14:06.548 FINE: Received ENTRY_CREATE event for unregistered file: /arquivos/git/validador-josm/Rules_Brazilian-Specific.validator.mapcss~ 2018-06-20 14:14:06.548 FINE: Received ENTRY_MODIFY event for unregistered file: /arquivos/git/validador-josm/.Rules_Brazilian-Specific.validator.mapcss.swp 2018-06-20 14:14:06.590 FINE: Received ENTRY_MODIFY event for unregistered file: /arquivos/git/validador-josm/.Rules_Brazilian-Specific.validator.mapcss.swp 2018-06-20 14:14:06.633 INFO: Source Brasil has been modified. Reloading it... 2018-06-20 14:14:06.718 INFO: Source Brasil has been modified. Reloading it...
- Saving and closing:
2018-06-20 14:15:11.956 FINE: Received ENTRY_CREATE event for unregistered file: /arquivos/git/validador-josm/Rules_Brazilian-Specific.validator.mapcss~ 2018-06-20 14:15:11.957 INFO: Source Brasil has been modified. Reloading it... 2018-06-20 14:15:11.978 INFO: Source Brasil has been modified. Reloading it... 2018-06-20 14:15:11.999 INFO: Source Brasil has been modified. Reloading it... 2018-06-20 14:15:12.046 INFO: Source Brasil has been modified. Reloading it...
Maybe it could be related with the ENTRY_CREATE
and ENTRY_MODIFY
of the unrelated .mapcss.swp
and .mapcss~
files?
ie, JOSM is receiving an unrelated event and reloading the validation file.
comment:4 by , 7 years ago
I am using vim
Maybe it's possible to watch only the registered file or ignore any unrelated event?
comment:5 by , 7 years ago
It seems Linux behaves differently than what I can see on Windows:
WatcherServices reports events twice because the underlying file is updated twice. Once for the content and once for the file modified time. These events happen within a short time span. To solve this, sleep between the poll() or take() calls and the key.pollEvents() call.
comment:6 by , 7 years ago
Milestone: | → 18.06 |
---|
comment:7 by , 7 years ago
Keywords: | reload file watch event added |
---|---|
Milestone: | 18.06 → 18.07 |
comment:8 by , 7 years ago
Milestone: | 18.07 → 18.08 |
---|
comment:9 by , 7 years ago
Milestone: | 18.08 |
---|
I can't reproduce with same version of Java and Windows. Do you have another machine with a different OS to see if it's specific to Debian?