{"action":"created","issue":{"url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/issues/661","labels_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/issues/661/labels{/name}","comments_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/issues/661/comments","events_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/issues/661/events","html_url":"https://github.com/UniversalMediaServer/UniversalMediaServer/pull/661","id":104566347,"number":661,"title":"Comparing computer clock with a NTP server during startup","user":{"login":"Nadahar","id":12900583,"avatar_url":"https://avatars.githubusercontent.com/u/12900583?v=3","gravatar_id":"","url":"https://api.github.com/users/Nadahar","html_url":"https://github.com/Nadahar","followers_url":"https://api.github.com/users/Nadahar/followers","following_url":"https://api.github.com/users/Nadahar/following{/other_user}","gists_url":"https://api.github.com/users/Nadahar/gists{/gist_id}","starred_url":"https://api.github.com/users/Nadahar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nadahar/subscriptions","organizations_url":"https://api.github.com/users/Nadahar/orgs","repos_url":"https://api.github.com/users/Nadahar/repos","events_url":"https://api.github.com/users/Nadahar/events{/privacy}","received_events_url":"https://api.github.com/users/Nadahar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-02T20:37:59Z","updated_at":"2015-09-03T20:21:08Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/pulls/661","html_url":"https://github.com/UniversalMediaServer/UniversalMediaServer/pull/661","diff_url":"https://github.com/UniversalMediaServer/UniversalMediaServer/pull/661.diff","patch_url":"https://github.com/UniversalMediaServer/UniversalMediaServer/pull/661.patch"},"body":"@UniversalMediaServer/developers Based on [this forum thread] (http://www.universalmediaserver.com/forum/viewtopic.php?f=14&t=3940&sid=f9091a23bf11166201425f4bfec8154f) I created this as a suggested solution.\r\n\r\nThere are some issues though:\r\n* There is a major bug somewhere that means that the dialog created by this sometimes makes UMS create two GUI's. When this happens NPE's start raining in from all over the place. I haven't been able to figure out why this happens, and it's not every time - which indicates some kind of a synchronization issue. I had to do this in a separate thread since the process of checking the NTP server can take anything from a few milliseconds to a minute or more - depending on network connectivity and NTP server response times, and the dialog is spawned from the thread. It tried it first with a callback to a static synchronized ```PMS``` method, but that obviously made no sense and gave the same results except that it also blocked the ```main``` thread until the dialog was closed.\r\n* Before I understood what happened, I started patching potential NPE's in ```UPNPControl``` and ```UPNPHelper``` (since they were the sources of the NPE's). I've left them in here for now, but I'm not really sure if these \"fixes\" are relevant to keep or should just be discarded.\r\n* We have to decide a time difference threshold for when UMS generates a warning. It's currently set to 5 seconds, but that's just to make testing easy.\r\n* What if the renderer's clock is off? The issue should probably be handled on a different level, does uPnP or DLNA have some mechanizm to handle this that's not being properly employed by UMS?\r\n* ```org.apache.commons.net``` is added to dependencies to provide access to ```org.apache.commons.net.ntp```. I'm unsure if this poses a problem or not.\r\n* I'm unsure of my english wording on this issue, what's the correct terms (too slow, too late, running late etc.)?"},"comment":{"url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/issues/comments/137563073","html_url":"https://github.com/UniversalMediaServer/UniversalMediaServer/pull/661#issuecomment-137563073","issue_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/issues/661","id":137563073,"user":{"login":"Nadahar","id":12900583,"avatar_url":"https://avatars.githubusercontent.com/u/12900583?v=3","gravatar_id":"","url":"https://api.github.com/users/Nadahar","html_url":"https://github.com/Nadahar","followers_url":"https://api.github.com/users/Nadahar/followers","following_url":"https://api.github.com/users/Nadahar/following{/other_user}","gists_url":"https://api.github.com/users/Nadahar/gists{/gist_id}","starred_url":"https://api.github.com/users/Nadahar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nadahar/subscriptions","organizations_url":"https://api.github.com/users/Nadahar/orgs","repos_url":"https://api.github.com/users/Nadahar/repos","events_url":"https://api.github.com/users/Nadahar/events{/privacy}","received_events_url":"https://api.github.com/users/Nadahar/received_events","type":"User","site_admin":false},"created_at":"2015-09-03T20:21:08Z","updated_at":"2015-09-03T20:21:08Z","body":"@skeptical It's now implemented with SwingUtilities.invokeLater(), the result is the same :confused: \r\n\r\n@SubJunk I didn't realize that you're not a part of the ```UniversalMediaServer/developers``` group, but now you're mentioned here as well :wink: "}}