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

Cannot run relayer commands concurrently #501

Closed
5 tasks done
romac opened this issue Jan 5, 2021 · 0 comments · Fixed by #562
Closed
5 tasks done

Cannot run relayer commands concurrently #501

romac opened this issue Jan 5, 2021 · 0 comments · Fixed by #562
Assignees
Labels
A: bug Admin: something isn't working
Milestone

Comments

@romac
Copy link
Member

romac commented Jan 5, 2021

Crate

relayer, relayer-cli, tendermint-light-client

Problem Definition

If one attempts to run two relayer commands concurrently (eg. tx raw packet-send while the relayer is running), they will be greeted with an error like:

error: client create failed: tx error: Light client error: IO error: could not acquire lock on "data/DEEB0AB3F2D7BEC0B8C9FF1532715635314F54D5/db": Os { code: 35, kind: WouldBlock, message: "Resource temporarily unavailable" }

This happens because each processes will instantiate a chain runtime which in turn will instantiate a light client, and both light clients will attempt to open the same sled database.

In turns out that sled does not allow multiple processes to have the database file open at once, hence the error above.

Proposal

Implement a new instance of the LightStore trait backed by a database which supports concurrent use across processes (eg. SQLite, RocksDB).

Alternatively, standalone commands (ie. tx commands) could use an in-memory light store, thus reserving the on-disk on for the main relayer loop (start command). This has performance implication for those commands as they will start from an empty light store and should thus be evaluated carefully.


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate milestone (priority) applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: bug Admin: something isn't working
Projects
None yet
1 participant