microsoft / microsoft/Qcodes

Sometimes database gets locked if a running measurement is interrupted

Open
#1,194 6 comments 0 reactions 0 assignees View on GitHub
bug new dataset
Dominant language
Python
Stars
459
Forks
359
Avg merge
3d 6h
Merged PRs (30d)
73

Description

This is not easy to reproduce. So, here is what happens: a measurement is running in a Jupyter notebook, data is being saved, then the measurement gets interrupted (say KeyboardInterrupt), and then the .db file gets locked. This means that no other program (including the running python kernel) can access the database, the returned error message states that the database is locked.

Restarting the python kernel solves this problem, meaning it unlocks the database.

I have a feeling that the low-level code that handles interaction with sqlite database does not always unlock the database in case of an exception.

Contributor guide

Open the contributing guide

Research direction

No file or test is named. Start by tracing the low-level SQLite interaction used while a measurement saves data from a Jupyter notebook, then investigate interruption with KeyboardInterrupt. Done means an interrupted measurement no longer leaves the .db file locked and the behavior is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, python, sqlite
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.