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

Zebra requires lock on data dir #19

Open
idky137 opened this issue Dec 17, 2024 · 5 comments · May be fixed by #79
Open

Zebra requires lock on data dir #19

idky137 opened this issue Dec 17, 2024 · 5 comments · May be fixed by #79
Assignees
Labels
bug Something isn't working

Comments

@idky137
Copy link
Contributor

idky137 commented Dec 17, 2024

Zebrad requires a lock on the data dir used to load chain data. This means that tests that load a chain cache must be run individually.

One option could be to copy the chain cache data into a tempdir for each test being.

@idky137 idky137 added the bug Something isn't working label Dec 19, 2024
@zancas zancas transferred this issue from another repository Feb 4, 2025
@ala-mode
Copy link
Contributor

ala-mode commented Feb 5, 2025

Acknowledged.

@ala-mode
Copy link
Contributor

ala-mode commented Feb 5, 2025

This is a duplicate of issue #7 - closing that issue.

@nachog00
Copy link
Contributor

nachog00 commented Feb 21, 2025

@idky137
How do you replicate this issue?
Would runs of zebrad consuming tests fail if they don't get the chain cache JUST like it came out of the cache generation process?
Would they fail with some particular error message if that is the failing cause?
Would they not fail at all but the test makes no sense anymore?

@zancas
Copy link
Member

zancas commented Feb 22, 2025

This issue seems to be related to zingolabs/zaino#114 since that issue requires Zebra regtest to load a cached chain, and this one requires tests to be runnable in parallel even when the tests in question cause a zebrads to access cached chains.

@nachog00 or @ala-mode would it make sense to list the tests that are affected by chain cache locks in this issue, or in a doc-comment in the relevant test mod?

@idky137
Copy link
Contributor Author

idky137 commented Feb 24, 2025

We don't have any tests specifically for this bug, we could write some if its needed?

The best way currently is to run cargo nextest run state_service ( you may have to run cargo nextest run --run-ignored ignored-only state_service as these tests are ignored in zingolabs/zaino#187 ).

You should see a big error string for most of the tests that contains the following message:

The application panicked (crashed).\nMessage:  Opening database \"/home/idky137/.cache/zebra/state/v26/regtest\" failed: Error { message: \"IO error: While lock file: /home/idky137/.cache/zebra/state/v26/regtest/LOCK: Resource temporarily unavailable\" }. Hint: Check if another zebrad process is running. Try changing the state cache_dir in the Zebra config.

if you run these tests (state_service) with no_capture you should not ever hit this error (although there may be other failures currently on dev).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Backlog
Development

Successfully merging a pull request may close this issue.

4 participants