ZStorm code should warn or error out on attempts to register a store with the transaction manager in the wrong thread
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Storm |
Fix Released
|
High
|
James Henstridge |
Bug Description
Today I was helping debug a problem in a multi-threaded app that uses the zstorm code to manage per-thread stores.
There was a bug in the code where a Storm object was passed from thread A to thread B to another. When the object was used, the associated store was registered with the transaction manager in thread B. The transaction in thread B was not committed.
When the program attempted to run the next transaction in thread A, it'd start using the same store which was already in an open transaction. Furthermore, because the store had been registered with thread B's transaction, committing in thread A doesn't commit the store.
If register_
This seems like an API misuse that is worthwhile trying to detect.
Related branches
- Jamu Kakar (community): Approve
- Thomas Herve (community): Approve
-
Diff: 162 lines (+58/-20)3 files modifiedNEWS (+3/-0)
storm/zope/zstorm.py (+21/-9)
tests/zope/zstorm.py (+34/-11)
Changed in storm: | |
assignee: | nobody → James Henstridge (jamesh) |
importance: | Undecided → High |
milestone: | none → 0.17 |
status: | New → In Progress |
Changed in storm: | |
status: | Fix Committed → Fix Released |
Fix merged in r359.