<p></p>
<p>I recently had a look at this and was able to reproduce the issue on regtest by running an Alice instance over and over in a loop. I think the problem is a threading issue coming from the <code>bisq.core.btc.setup.WalletsSetup</code> class at the <code>UserThread::runAfter</code> method call. I added a couple of temporary log statements to the class as follows:</p>
<p><a target="_blank" rel="noopener noreferrer" href="https://user-images.githubusercontent.com/54855381/78338308-1e904580-75c5-11ea-9c3a-8f285a4b46b6.png"><img src="https://user-images.githubusercontent.com/54855381/78338308-1e904580-75c5-11ea-9c3a-8f285a4b46b6.png" alt="Screenshot from 2020-04-03 14-36-23" style="max-width:100%;"></a></p>
<p>Interestingly, adding the second log statement seemed to suppress the issue. At least, after starting the application 200 times it failed to show the password window only once, but on that occasion it failed to move past the splash screen at all (apparently because it failed to run the result handler passed to <code>UserThread::runAfter</code>).</p>
<p>After commenting out the second log statement and running Alice another 100 times, it got past the splash screen without showing the password window 5 times. Here is a screenshot of the relevant log output:</p>
<p><a target="_blank" rel="noopener noreferrer" href="https://user-images.githubusercontent.com/54855381/78339133-94e17780-75c6-11ea-904f-4d1a6b306c6d.png"><img src="https://user-images.githubusercontent.com/54855381/78339133-94e17780-75c6-11ea-904f-4d1a6b306c6d.png" alt="Screenshot from 2020-04-03 12-48-56" style="max-width:100%;"></a></p>
<p>As can be seen (from extra temp logging I put in <code>bisq.core.app.WalletAppSetup</code>), it enters the result handler in the user thread <em>before</em> it returns from the lambda passed into the previous <code>UserThread::execute</code> call (on a different thread) on line 254 in <code>WalletsSetup</code>.</p>
<p>I think the second log statement creates a happens-before relationship between the two updates to the internal JavaFX timeline made by the <code>execute</code> and <code>runAfter</code> calls, and without it the tasks can be scheduled out-of-order. As noted in the FIXME, <code>runAfter</code> is not meant to be run outside the user thread because it makes calls to non-thread-safe parts of the JavaFX API (almost all of it).</p>
<p>It should be fairly easy to fix the issue I think, e.g. by moving the <code>runAfter</code> call into the <code>execute</code> lambda. It might be worth searching for any other incorrect uses of <code>runAfter</code> in the codebase.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/bisq-network/bisq/issues/4055#issuecomment-608326822">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNS3X7CZ2FLYDOZVOLDRKWSNXANCNFSM4LGNXRPA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AJFFTNUENWQZPFBSYHMHVATRKWSNXA5CNFSM4LGNXRPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOERBFJJQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/bisq-network/bisq/issues/4055#issuecomment-608326822",
"url": "https://github.com/bisq-network/bisq/issues/4055#issuecomment-608326822",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>