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

handle SQLITE_BUSY #435

Closed
Tracked by #349
xlc opened this issue Oct 12, 2023 · 0 comments · Fixed by #467
Closed
Tracked by #349

handle SQLITE_BUSY #435

xlc opened this issue Oct 12, 2023 · 0 comments · Fixed by #467
Assignees

Comments

@xlc
Copy link
Member

xlc commented Oct 12, 2023

2023-10-12 13:55:23        REGISTRY: Unknown signed extensions SetEvmOrigin found, treating them as no-effect
/Users/xiliangchen/projects/acala/chopsticks/node_modules/typeorm/src/driver/sqlite/SqliteQueryRunner.ts:113
                    fail(new QueryFailedError(query, parameters, err))
                         ^
QueryFailedError: SQLITE_BUSY: database is locked
    at Statement.handler (/Users/xiliangchen/projects/acala/chopsticks/node_modules/typeorm/src/driver/sqlite/SqliteQueryRunner.ts:113:26) {
  query: 'INSERT INTO "key_value_pair"("blockHash", "key", "value") VALUES (?, ?, ?) ON CONFLICT ( "key", "blockHash" ) DO UPDATE SET "key" = EXCLUDED."key", "blockHash" = EXCLUDED."blockHash", "value" = EXCLUDED."value"',
  parameters: [
    '0xeafd4ab80514098b700bb466ae41634ce5ebf77ba29000ef53c2b0c0ed121ef9',
    '0xcec5070d609dd3497f72bde07fc96ba088dcde934c658227ee1dfafcd6e16903',
    '0x24b210cf0dbf420316bc903243152a71e9a851f7b407c9e39c0f3c152cfdcbc6151e30aa51ad68b8918d2c46e914986818c111bee03582610cbc9fb73fe0e4c4134660eeb3476a1684be209384c5deb03cbaf0ba405f5092cfe8c34dd3b6df353e4c99b4a7baea915dad709a6bc04dbd5098661219be8059b212310f733925fc1654ddd7080a732e544a88a2c0b52c8b793b08bfc9a0ffbbcc6591d697496f8d0f5ac09ed30bf9c17475373689bb8965cf5c3cd9cff1894f407310acd892d4f1659a9403f1b8480ce61732b01a1450dd5ab5978dbd9502aec13498e607400d8812c8ace959897f86f0075f213815c871662fe66a1f37356499e68d13f649ac437ce6dc327fff79c98872e22b11aef9829c602ed02829876534d0c5a6a48f216d10'
  ],
  driverError: [Error: SQLITE_BUSY: database is locked] {
    errno: 5,
    code: 'SQLITE_BUSY'
  },
  errno: 5,
  code: 'SQLITE_BUSY'
}

should handle the error and retry the query

this happens when multiple instances are accessing a same db file concurrently

@xlc xlc mentioned this issue Oct 20, 2023
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants