{"action":"created","issue":{"url":"https://api.github.com/repos/instacart/truetime-android/issues/78","repository_url":"https://api.github.com/repos/instacart/truetime-android","labels_url":"https://api.github.com/repos/instacart/truetime-android/issues/78/labels{/name}","comments_url":"https://api.github.com/repos/instacart/truetime-android/issues/78/comments","events_url":"https://api.github.com/repos/instacart/truetime-android/issues/78/events","html_url":"https://github.com/instacart/truetime-android/issues/78","id":316308204,"number":78,"title":"TrueTime.now() block UI on InvalidNtpServerResponseException","user":{"login":"tapeo","id":12783325,"avatar_url":"https://avatars2.githubusercontent.com/u/12783325?v=4","gravatar_id":"","url":"https://api.github.com/users/tapeo","html_url":"https://github.com/tapeo","followers_url":"https://api.github.com/users/tapeo/followers","following_url":"https://api.github.com/users/tapeo/following{/other_user}","gists_url":"https://api.github.com/users/tapeo/gists{/gist_id}","starred_url":"https://api.github.com/users/tapeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tapeo/subscriptions","organizations_url":"https://api.github.com/users/tapeo/orgs","repos_url":"https://api.github.com/users/tapeo/repos","events_url":"https://api.github.com/users/tapeo/events{/privacy}","received_events_url":"https://api.github.com/users/tapeo/received_events","type":"User","site_admin":false},"labels":[{"id":444822267,"url":"https://api.github.com/repos/instacart/truetime-android/labels/wip","name":"wip","color":"c5def5","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-04-20T15:16:13Z","updated_at":"2018-05-29T00:56:24Z","closed_at":null,"author_association":"NONE","body":"Hi! These days, using the `TrueTime.now()` function, there was a problem concerning the locking of the UI without an actual crash. In fact Android showed the ANR message and the application did not respond to the touch.\r\nI initialized truetime with the following function:\r\n\r\n```\r\nAsyncTask.execute(new Runnable() {\r\n                @Override\r\n                public void run() {\r\n                    try {\r\n\r\n                            TrueTime.build()\r\n                                    .withNtpHost(TRUETIME_SERVER)\r\n                                    .initialize();\r\n\r\n                            Log.e(\"TrueTime\", \"Connected\");\r\n                       \r\n                    } catch (Exception e) {\r\n                        e.printStackTrace();\r\n                    }\r\n                }\r\n            });\r\n```\r\n\r\nand I run the `TrueTime.now().getTime()` method every 7 seconds. This is the stacktrace.\r\nAny information about it? Thank you!\r\n\r\n```\r\nDALVIK THREADS (15):\r\n\"main\" prio=5 tid=1 Blocked\r\n  | group=\"main\" sCount=1 dsCount=0 obj=0x73ec9700 self=0xb749b300\r\n  | sysTid=3698 nice=0 cgrp=default sched=0/0 handle=0xb6f1fbec\r\n  | state=S schedstat=( 333721878 8851080 272 ) utm=31 stm=2 core=2 HZ=100\r\n  | stack=0xbe53d000-0xbe53f000 stackSize=8MB\r\n  | held mutexes=\r\n  at truetime.SntpClient.wasInitialized(SntpClient.java:225)\r\n  - waiting to lock <0x01a6f754> (a truetime.SntpClient) held by thread 15\r\n  at truetime.TrueTime.isInitialized(TrueTime.java:44)\r\n  at truetime.TrueTime.now(TrueTime.java:30)\r\n  at com.package.ButtonPresenter.initAnimation(ActivityPresenter.java:135)\r\n  at com.package.ButtonPresenter.<init>(ActivityPresenter.java:83)\r\n  at com.package.ButtonFragment.onCreateView(ButtonView.java:76)\r\n  at android.support.v4.app.Fragment.performCreateView(Fragment.java:2354)\r\n  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1419)\r\n  at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1740)\r\n  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1809)\r\n  at android.support.v4.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3217)\r\n  at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:3171)\r\n  at android.support.v4.app.FragmentController.dispatchActivityCreated(FragmentController.java:192)\r\n  at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:560)\r\n  at android.support.v7.app.AppCompatActivity.onStart(AppCompatActivity.java:177)\r\n  at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1236)\r\n  at android.app.Activity.performStart(Activity.java:6238)\r\n  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2307)\r\n  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2407)\r\n  at android.app.ActivityThread.access$800(ActivityThread.java:151)\r\n  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1319)\r\n  at android.os.Handler.dispatchMessage(Handler.java:102)\r\n  at android.os.Looper.loop(Looper.java:135)\r\n  at android.app.ActivityThread.main(ActivityThread.java:5280)\r\n  at java.lang.reflect.Method.invoke!(Native method)\r\n  at java.lang.reflect.Method.invoke(Method.java:372)\r\n  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:963)\r\n  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:758)\r\n\r\n```\r\n\r\n```\r\n04-14 20:43:08.402 1861-1899/com.package W/System.err: .truetime.InvalidNtpServerResponseException: server_response_delay too large for comfort 1452,000000 [actual] >= 200,000000 [expected]\r\n        at .truetime.SntpClient.requestTime(SntpClient.java:182)\r\n        at .truetime.TrueTime.requestTime(TrueTime.java:125)\r\n        at .truetime.TrueTime.initialize(TrueTime.java:121)\r\n        at .truetime.TrueTime.initialize(TrueTime.java:56)\r\n04-14 20:43:08.412 1861-1899/com.package E/trueTimeError: server_response_delay too large for comfort 1452,000000 [actual] >= 200,000000 [expected]\r\n04-14 20:43:44.162 1910-1932/com.package W/System.err:     at .truetime.SntpClient.requestTime(SntpClient.java:121)\r\n        at .truetime.TrueTime.requestTime(TrueTime.java:125)\r\n        at .truetime.TrueTime.initialize(TrueTime.java:121)\r\n        at .truetime.TrueTime.initialize(TrueTime.java:56)\r\n        at .ButtonFragment$7.run(ButtonFragment.java:128)\r\n        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)\r\n        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)\r\n        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)\r\n        at java.lang.Thread.run(Thread.java:841)\r\n    Caused by: libcore.io.ErrnoException: recvfrom failed: EAGAIN (Try again)\r\n        at libcore.io.Posix.recvfromBytes(Native Method)\r\n        at libcore.io.Posix.recvfrom(Posix.java:141)\r\n        at libcore.io.BlockGuardOs.recvfrom(BlockGuardOs.java:164)\r\n        at libcore.io.IoBridge.recvfrom(IoBridge.java:506)\r\n    \t... 12 more\r\n```"},"comment":{"url":"https://api.github.com/repos/instacart/truetime-android/issues/comments/392624413","html_url":"https://github.com/instacart/truetime-android/issues/78#issuecomment-392624413","issue_url":"https://api.github.com/repos/instacart/truetime-android/issues/78","id":392624413,"user":{"login":"kaushikgopal","id":1042037,"avatar_url":"https://avatars0.githubusercontent.com/u/1042037?v=4","gravatar_id":"","url":"https://api.github.com/users/kaushikgopal","html_url":"https://github.com/kaushikgopal","followers_url":"https://api.github.com/users/kaushikgopal/followers","following_url":"https://api.github.com/users/kaushikgopal/following{/other_user}","gists_url":"https://api.github.com/users/kaushikgopal/gists{/gist_id}","starred_url":"https://api.github.com/users/kaushikgopal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaushikgopal/subscriptions","organizations_url":"https://api.github.com/users/kaushikgopal/orgs","repos_url":"https://api.github.com/users/kaushikgopal/repos","events_url":"https://api.github.com/users/kaushikgopal/events{/privacy}","received_events_url":"https://api.github.com/users/kaushikgopal/received_events","type":"User","site_admin":false},"created_at":"2018-05-29T00:56:24Z","updated_at":"2018-05-29T00:56:24Z","author_association":"COLLABORATOR","body":"master should have this fix. for those eager to take this for a spin try \r\n\r\n`implementation com.github.instacart.truetime-android:library-extension-rx:09087b6a6e` \r\n\r\nThat should point to the latest commit on master"}}
{"actor":{"display_login":"kaushikgopal"}}