Multithreaded access error when validating fields
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- backend, testing-qa
Research direction
Start in epicsdbbuilder/dbd.py by reading ValidateDbField and ValidateFieldValue, including the DBEntry cursor use around the reported line 91. Reproduce the intermittent failure through the multithreaded validation exercised by PythonSoftIOC's scheduled testing, and confirm the work is done when concurrent validation no longer produces the reported fldDes-not-found assertion.
Written by the indexing model from the issue text.
Description
It seems that part(s) of epicsdbbuilder are not threadsafe. Inside of ValidateDbField is a single DBEntry item, which is used as a cursor into a database. However, inside the ValidateFieldValue method, which can be called from multiple threads simultaneously, the cursor gets re-used for multiple invocations.
This has the end result of creating an error message like this:
AssertionError: Can't write "@PV-FROM-CM" to field OUT: fldDes not found
Which comes from this line.
This was originally spotted in PythonSoftIOC's scheduled testing, where this error message very occasionally appears during scheduled testing. See this issue.
- Dominant language
- Python
- Stars
- 9
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from DiamondLightSource/epicsdbbuilder
-
Dependency Dashboard Open
Difficulty 1/5 Under an hour Newbie friendliness 20/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
DiamondLightSource/epicsdbbuilder#33 · 3 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
DiamondLightSource/epicsdbbuilder#2 · 5 comments ·
All issues in DiamondLightSource/epicsdbbuilder
Similar issues
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
simonw/sqlite-utils#872 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100