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

diskcache: sqlite3.OperationalError: database is locked #92

Open
jayvdb opened this issue Apr 7, 2020 · 1 comment
Open

diskcache: sqlite3.OperationalError: database is locked #92

jayvdb opened this issue Apr 7, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@jayvdb
Copy link
Owner

jayvdb commented Apr 7, 2020

Running two instances together may result in an exception. I frequently do this, and this is the first and only time it has occurred.

py38 run-test: commands[0] | coverage run -m pypidb requests-threads
Traceback (most recent call last):
  File "/home/jayvdb/projects/pypi2vcs/release/pypidb/__main__.py", line 4, in <module>
    cli()
  File "/home/jayvdb/projects/pypi2vcs/release/.tox/py38/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/jayvdb/projects/pypi2vcs/release/.tox/py38/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/jayvdb/projects/pypi2vcs/release/.tox/py38/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/jayvdb/projects/pypi2vcs/release/.tox/py38/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/jayvdb/projects/pypi2vcs/release/pypidb/cli.py", line 13, in cli
    db = Database()
  File "/home/jayvdb/projects/pypi2vcs/release/pypidb/_db.py", line 101, in __init__
    from ._pypi import Converter
  File "/home/jayvdb/projects/pypi2vcs/release/pypidb/_pypi.py", line 24, in <module>
    from ._rules import DefaultRule, _find_named_repo, rules
  File "/home/jayvdb/projects/pypi2vcs/release/pypidb/_rules.py", line 49, in <module>
    dns_cache = NoExpirationDiskCache(directory=dns_cache_dirpath, min_ttl=NO_EXPIRY)
  File "/home/jayvdb/projects/pypi2vcs/release/.tox/py38/lib/python3.8/site-packages/dns_cache/diskcache.py", line 16, in __init__
    super(DiskCache, self).__init__(*args, **kwargs)
  File "/home/jayvdb/projects/pypi2vcs/release/.tox/py38/lib/python3.8/site-packages/dns_cache/diskcache.py", line 11, in __init__
    self.data = dc.Cache(directory)
  File "/home/jayvdb/projects/pypi2vcs/release/.tox/py38/lib/python3.8/site-packages/diskcache/core.py", line 528, in __init__
    sql(query, (key, value))
  File "/home/jayvdb/projects/pypi2vcs/release/.tox/py38/lib/python3.8/site-packages/diskcache/core.py", line 693, in _execute_with_retry
    return sql(statement, *args, **kwargs)
sqlite3.OperationalError: database is locked
@jayvdb jayvdb added the bug Something isn't working label Apr 7, 2020
@jayvdb
Copy link
Owner Author

jayvdb commented Apr 7, 2020

It happened again, and the other process running atm is stuck on pytest-rerunfailures

tests/test_failures.py ...........................................................................................R

Lock resolved after the other processes finished.

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
None yet
Development

No branches or pull requests

1 participant