New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot list wallets when using same state directory but different genesis #1292
Comments
Confirmed on |
@jonathanknowles I did some investigation yesterday. The main issue is due to the worker not being unregistered from the registry when it dies. |
@KtorZ wrote:
Yes, I found the same thing in my investigation. But there's something else that's going on. The current implementation of Though the comment of the function explains that One possibility here would be to change this function so that if Thoughts? |
Just for the record: we discussed this in our team meeting and agreed to adjust the worker life cycle so that |
1301: Simplify worker registration lifecycle. r=jonathanknowles a=jonathanknowles # Issue Number #1292 # Overview This PR adjusts the worker registration life cycle so that creating and registering a worker is now a single operation, rather than a two-step operation. Whereas previously callers would need to first call `newWorker` followed by `insert`, they now only need to call `register`. In addition, we now provide automatic garbage collection of stale worker references from the registry, so that attempting to look up a previously-registered but prematurely-terminated thread will result in `Nothing`. Co-authored-by: Jonathan Knowles <jonathan.knowles@iohk.io>
We should investigate what would happen if a worker thread dies, w.r.t. Daedalus. With PR #1301, if a worker thread dies, then its key is removed from the registry. In that case, the wallet will no longer be listed by |
1474: Mark wallet as "dead" when underlying workers die r=KtorZ a=KtorZ # Issue Number <!-- Put here a reference to the issue this PR relates to and which requirements it tackles --> #1292 (in particular, last comment: #1292 (comment)) # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - 551a463 move list databases to enable server calling it from API handlers When a wallet worker dies, it is removed from the registry and therefore, is no longer available for listing. Yet, the file might still exist on disk, so looking at the database files is more reliable than looking at the registered workers. Should a worker be dead however, operation on a wallet should be degraded - 27b19a6 create a new 'ErrDeadWallet' to capture dead workers - c3ce89a list workers through known databases and allow recovering from a dead worker With this, we could still return wallet as degraded when listing and fetching them independently. At least, it indicates client that something went wrong and despite being stuck, wallets remains accessible. - 4978205 marks wallets as 'dead' when fetching them despite a worker being dead # Comments <!-- Additional comments or screenshots to attach if any --> Kinda hard to test because workers ain't supposed to die in practice 😬 ... So, I injected a temporary fault in the restoration loop to make the worker dies immediately and it works as expected: <details> <summary>curl http://localhost:8090/v2/byron-wallets | jq</summary> ```json [ { "passphrase": { "last_updated_at": "2020-03-23T11:36:12.582891065Z" }, "state": { "status": "dead" }, "balance": { "total": { "quantity": 0, "unit": "lovelace" }, "available": { "quantity": 0, "unit": "lovelace" } }, "name": "MyWallet", "id": "adc78398110d92af3132488546c6977f61dc0c7e", "tip": { "height": { "quantity": 0, "unit": "block" }, "epoch_number": 0, "slot_number": 0 } } ] ``` </details> <details> <summary>curl http://localhost:8090/v2/byron-wallets/{walletId} | jq</summary> ```json { "passphrase": { "last_updated_at": "2020-03-23T11:36:12.582891065Z" }, "state": { "status": "dead" }, "balance": { "total": { "quantity": 0, "unit": "lovelace" }, "available": { "quantity": 0, "unit": "lovelace" } }, "name": "MyWallet", "id": "adc78398110d92af3132488546c6977f61dc0c7e", "tip": { "height": { "quantity": 0, "unit": "block" }, "epoch_number": 0, "slot_number": 0 } } ``` </details> <details> <summary>Anything else</summary> ```json { "code": "wallet_is_dead", "message": "That's embarassing. My associated worker for adc78398110d92af3132488546c6977f61dc0c7e is no longer responding. This is not something that is supposed to happen. The worker must have left a trace in the logs of severity 'Error' when it died which might explain the cause. Said differently, this wallet won't be accessible until the server is restarted but there are good chances it'll recover itself upon restart." } ``` </details> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Assign the PR to a corresponding milestone ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: KtorZ <matthias.benkort@gmail.com>
Context
#1281 (comment)
Steps to Reproduce
In the log there is:
and then:
Expected behavior
Actual behavior
Resolution
QA
The text was updated successfully, but these errors were encountered: