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

BUG : SQLITE Busy error after multiple inserts #443

Open
xr1337 opened this issue Jan 18, 2024 · 1 comment
Open

BUG : SQLITE Busy error after multiple inserts #443

xr1337 opened this issue Jan 18, 2024 · 1 comment
Assignees

Comments

@xr1337
Copy link

xr1337 commented Jan 18, 2024

Describe the bug

After a few subsequent event insertion, SQLite sqlite3_step() returns busy state. The SDK does not retry the assertion attempt.

Observation

Function saveEvent(_ message: String) does not check for SQLITE_BUSY and assumes error when no SQLITE_DONE is returned. In fact sqlite3_step can return the following values:

  • SQLITE_BUSY
  • SQLITE_ERROR
  • SQLITE_MISUSE

References:
https://github.com/rudderlabs/rudder-sdk-ios/blob/master-v2/Sources/Classes/Client/RSDatabaseManager.swift#L50
https://www.sqlite.org/c3ref/step.html

To Reproduce
Steps to reproduce the behaviour:

  1. Initialise iOS SDK in iOS app
  2. Run app on device
  3. Fire multiple event and notice the Event insertion error in console:
  4. Event is not saved in database

Expected behavior
Upon receiving a busy state, we expect the SDK to retry insertion again later.

Version of the iOS SDK
iOS SDK v2.4.2

** Initialization used **

let config: RSConfig = RSConfig(writeKey: getKey())
      .dataPlaneURL(getDataPlaneURL())
      .loglevel(.debug)
      .trackLifecycleEvents(true)
      .recordScreenViews(true)
    RSClient.sharedInstance().configure(with: config)
@pallabmaiti
Copy link
Contributor

We will look into it.

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

No branches or pull requests

2 participants