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

Fix TrueNAS locking contention #2653

Merged
3 commits merged into from
Nov 11, 2022
Merged

Conversation

neilschelly
Copy link
Contributor

Pre-Request Checklist

  • Passes rubocop code analysis (try rubocop --auto-correct)
  • Tests added or adapted (try rake test)
  • Changes are reflected in the documentation
  • User-visible changes appended to CHANGELOG.md

Description

There's an occasional race condition in the TrueNAS module. When the TrueNAS software is accessing the SQLite database, the command to dump it will fail and output only:

/**** ERROR: (5) database is locked *****/
ROLLBACK; -- due to errors

This command invocation ought to get it to open even if it's locked, with the promise of being a read-only session.

…s, which are tougher to square away inside the docker container:

```
I, [2022-11-08T16:00:47.176135 ytti#1]  INFO -- : Oxidized starting, running as pid 1
I, [2022-11-08T16:00:47.183041 ytti#1]  INFO -- : lib/oxidized/nodes.rb: Loading nodes
I, [2022-11-08T16:00:47.780358 ytti#1]  INFO -- : lib/oxidized/nodes.rb: Loaded 13 nodes
Puma starting in single mode...
* Version 3.11.4 (ruby 2.7.0-p0), codename: Love Song
* Min threads: 0, max threads: 16
* Environment: development
* Listening on tcp://0.0.0.0:8888
Use Ctrl-C to stop
F, [2022-11-08T16:00:55.490046 ytti#1] FATAL -- : Oxidized crashed, crashfile written in /root/.config/oxidized/crash
config value 'safe.directory' was not found
```

I'm not sure this is the "right" fix, because I think that maybe the _real_ answer is to make sure the permissions for the git repo inside the container are set correctly so that `safe.directory` configurations aren't necessary.
…rueNAS

Occasionally, without this, the resulting output would be:
```
/**** ERROR: (5) database is locked *****/
ROLLBACK; -- due to errors
```

This should allow the command to run even if the database is locked.
@ghost
Copy link

ghost commented Nov 9, 2022

Please add your changes to CHANGELOG.md

@ghost ghost merged commit 37ad8d4 into ytti:master Nov 11, 2022
@agrevtcev agrevtcev mentioned this pull request Nov 15, 2022
4 tasks
This pull request was closed.
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

Successfully merging this pull request may close these issues.

1 participant