IllegalStateException when BriarService is recreated after startup
- Android version: 5.1.1
- Phone model: Samsung SM-J320M (j3xlteub)
- Briar version: 1.2.7 (eb562f8f)
java.lang.IllegalStateException at org.briarproject.bramble.network.AndroidNetworkManager.startService(AndroidNetworkManager.java:71) at org.briarproject.bramble.lifecycle.LifecycleManagerImpl.startServices(LifecycleManagerImpl.java:130) at org.briarproject.briar.android.BriarService.lambda$onCreate$0$BriarService(BriarService.java:133) at org.briarproject.briar.android.-$$Lambda$BriarService$Ihm6XxaER2EMRlAKzUA1GpEtxZU.run(lambda) at java.lang.Thread.run(Thread.java:818)
06-04 12:25:55.414 I/TorPlugin: First circuit built 06-04 12:25:55.424 I/PollerImpl: Polling plugin org.briarproject.bramble.tor 06-04 12:25:55.428 I/TorPlugin: Connecting to sak[scrubbed] 06-04 12:26:25.431 I/TorPlugin: Could not connect to sak[scrubbed]: java.net.SocketTimeoutException 06-04 12:26:27.252 I/BaseActivity: Starting NavDrawerActivity 06-04 12:26:27.266 I/BriarService: Created 06-04 12:26:27.273 I/LifecycleManagerImpl: Opening database 06-04 12:26:27.299 I/H2Database: Reopening DB: true 06-04 12:26:27.306 I/JdbcDatabase: 2217908857 ms since last compaction 06-04 12:26:27.328 I/LifecycleManagerImpl: Starting services
The exception is a canary that's meant to warn us about singletons being reused in violation of their expected lifecycle.
The log shows that TorPlugin and PollerImpl were already running before BriarService was created. The database must have been open too, as the poller was able to load a contact's transport properties.
It looks like a new BriarService instance was created when one already existed, or used to exist. The BriarService instance also has a canary to check for reuse, so this must be a new instance.