Skip to content

LevelDB Locking Issue with ClassicLevel in Node.js Server Using RAILGUN SDK #110

@nad33mahm3d

Description

@nad33mahm3d

I'm encountering a database locking issue when using ClassicLevel with the RAILGUN SDK in a Node.js backend service. The issue occurs during initialization or under concurrent request load. In some cases, the database hangs in 'opening' state

What I'm doing:
Using ClassicLevel as the database for startRailgunEngine.
Manually deleting and recreating the LevelDB directory on startup to avoid stale locks.
Awaiting levelDb.open() before passing it to startRailgunEngine.
Using a singleton instance of RailgunService.

Expected Behavior:
The DB should initialize without locking errors.
Concurrent requests should not interfere with the DB instance.
The engine should remain usable for all wallet-related operations.

Actual Behavior:
Under load or server restart, I encounter one or more of the following:
levelDb.status remains opening
LOCK file errors
RAILGUN SDK fails to initialize

Environment:
Node.js: v20.15.1
RAILGUN SDK: "@railgun-community/shared-models": "^7.6.2", "@railgun-community/wallet": "^10.4.0"
LevelDB: "classic-level": "^3.0.0",
OS: macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions