Skip to content
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

`Command runner exits with 'Diesel error: database is locked' #4555

Closed
hansieodendaal opened this issue Aug 29, 2022 · 5 comments
Closed

`Command runner exits with 'Diesel error: database is locked' #4555

hansieodendaal opened this issue Aug 29, 2022 · 5 comments
Assignees

Comments

@hansieodendaal
Copy link
Contributor

hansieodendaal commented Aug 29, 2022

Edit: Title changed from Wallet panics with 'Diesel error: database is locked' to Command runner exits with 'Diesel error: database is locked' (The wallet did not actually panic)

Examples:

  • Invalid command. Output manager error: Output manager storage error: Diesel error: `database is locked```
  • Invalid command. Output manager error: Key manager service error : Storage error: Diesel error: `database is locked```

Probable (most likely) cause:

  • spawn blocking sql db calls

The command script file (condensed for legibility):

# Let us stress the network

get-balance

# 1 of 140
coin-split 0.01T 499
# 2 of 140
coin-split 0.01T 499
.
.
.
# 140 of 140
coin-split 0.01T 499

@stringhandler
Copy link
Collaborator

Needs some more detail

@hansieodendaal hansieodendaal self-assigned this Aug 29, 2022
stringhandler pushed a commit that referenced this issue Aug 30, 2022
#4564)

Description
---
Removed spawn blocking calls for db operations from the wallet in the key manager service. (This is another PR in a couple of PRs required to implement this fully throughout the wallet code.)

Motivation and Context
---
As per #3982 and #4555

How Has This Been Tested?
---
Unit tests
Cucumber tests
stringhandler pushed a commit that referenced this issue Aug 31, 2022
…4575)

Description
---
- Removed spawn blocking calls for db operations from the wallet in the contacts service. (This is another PR in a couple of PRs required to implement this fully throughout the wallet code.)
- Reset the wallet's default db connection pool size back to 16 (from 5).

Motivation and Context
---
As per #3982 and #4555

How Has This Been Tested?
---
Unit tests
Cucumber tests
System-level test
jorgeantonio21 pushed a commit to jorgeantonio21/tari that referenced this issue Aug 31, 2022
…ari-project#4575)

Description
---
- Removed spawn blocking calls for db operations from the wallet in the contacts service. (This is another PR in a couple of PRs required to implement this fully throughout the wallet code.)
- Reset the wallet's default db connection pool size back to 16 (from 5).

Motivation and Context
---
As per tari-project#3982 and tari-project#4555

How Has This Been Tested?
---
Unit tests
Cucumber tests
System-level test
stringhandler pushed a commit that referenced this issue Aug 31, 2022
Description
---
Removed spawn blocking calls for db operations from the wallet in the wallet storage. (This is another PR in a couple of PRs required to implement this fully throughout the wallet code.)

Motivation and Context
---
As per #3982 and #4555

How Has This Been Tested?
---
Unit tests
Cucumber tests
@hansieodendaal
Copy link
Contributor Author

Related PRs to fix this before another test is attempted: #4564, #4575, #4591 and #4597.

sdbondi pushed a commit that referenced this issue Sep 2, 2022
…ing (transaction service) (#4597)

Description
---
Removed spawn blocking calls for db operations from the wallet in the transaction service.
(This is the last  PR in a couple of PRs required to implement this fully throughout the wallet code.)

Motivation and Context
---
As per #3982 and #4555

How Has This Been Tested?
---
Unit tests
Cucumber tests
@hansieodendaal
Copy link
Contributor Author

hansieodendaal commented Sep 5, 2022

Feedback:

  • I could perform 200 coin spilts producing 99,800 UTXOs on each of 3 wallets successfully without encountering the Diesel error: 'database is locked' error.
  • However, trying to perform the same test again afterward using the same wallets (with the added transaction and outputs data from the previous test) resulted in the Diesel error: 'database is locked' error.

@hansieodendaal
Copy link
Contributor Author

We have implemented all the recommended pragmas
Our error condition is described here: https://www.sqlite.org/rescode.html#locked
#4613 may help to fix the continued error

See related discussion in stackoverflow

@hansieodendaal
Copy link
Contributor Author

See #4615 - Diesel error: 'database is locked' is not a non-recoverable error but the command runner stopped prematurely.

stringhandler pushed a commit that referenced this issue Sep 6, 2022
Description
---
Added error handling to the wallet command runner so that the system can gracefully recover rather than stop executing.
This will also help to sort out the issues in #4555 as those long scripts exit prematurely.

Motivation and Context
---
Command execution stopped prematurely.

How Has This Been Tested?
---
System level tests
@hansieodendaal hansieodendaal changed the title Wallet panics with Diesel error: database is locked `Command runner exits with 'Diesel error: database is locked' Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants