okta / okta-devices-swift

okta-devices-swift
https://github.com/okta/okta-devices-swift
Apache License 2.0
8 stars 1 forks source link

OKTA-564428 - Add timeout configuration value for concurrent SQLIte requests to reduce probability of SQLITE_BUSY errors #95

Closed IldarAbdullin-okta closed 1 year ago

IldarAbdullin-okta commented 1 year ago

Problem Analysis (Technical)

Add configuration.busyMode = .timeout(1) to sqlite configuration. This allows grdb to wait for 1 second before retrying in case if write operation returned SQLITE_BUSY error

IldarAbdullin-okta commented 1 year ago

👍 Curious what was the reason of this change? was it retrying too quickly?

Default config is:

/// The SQLITE_BUSY error is immediately returned to the connection that tries to access the locked database.
case immediateError