Comments (3)
Hi! I'm a maintainer of gevent and I've also contributed to this library. My organization runs a gevent-patched system that heavily uses transaction
and I don't recall that we've run into any trouble. I also don't think we have any special code, aside from an assert in one of our modules:
assert issubclass(transaction.ThreadTransactionManager, gevent.local.local)
This makes sure that the monkey-patching has been done soon enough. The trick, as gevent tries to document, is to make sure that monkey-patching is done immediately during process startup, before any other imports. In our case, we have modified pserve
to do the patching, but that might differ in a given environment.
Our assert code is slightly more general than that to account for other thread-local things we're aware of. I can share it if that would be helpful.
from transaction.
I moved gevent.monkey.patch_all()
to very early in my program and managed to resolve the issue.
from transaction.
@jamadden Here is the description of the sympton: ThreadTransactionManager gives same _txn
even if the thread differs.
Thread is <ServiceThread(xxx, started 4449301920)>, manager is <transaction._manager.ThreadTransactionManager object at 0x1072e0e88>, Tx is <transaction._transaction.Transaction object at 0x109373fd0>
Thread is <ServiceThread(yyy, started 4449302072)>, manager is <transaction._manager.ThreadTransactionManager object at 0x1072e0e88>, Tx is <transaction._transaction.Transaction object at 0x109373fd0>
This is using threads started with threading.Thread.start
.
I'd assume I need to get patched threading.Thread
?
from transaction.
Related Issues (20)
- 3.0.1: pytest warnings HOT 8
- 3.0.1: setuptools build_sphinx command fails HOT 11
- 3.0.1: transaction not sphinx 4.0.x ready? HOT 5
- Print the stack when a resource manager joins a transaction HOT 4
- Question: Nested transaction.manager HOT 2
- Add support for QA tooling? HOT 3
- 3.0.1: sphinx warnings `reference target not found` HOT 1
- Transactions with multiprocessing HOT 2
- Question: How to find a transaction’s data manager, if any? HOT 1
- No status to indicate aborted transaction. HOT 7
- Reach 100% coverage HOT 1
- DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working HOT 2
- 'ThreadTransactionManager' object has no attribute '_retryable' HOT 1
- Support abort hooks (symmetrically to commit hooks) HOT 1
- It's very easy to create reference cycles that require the GC to clean up HOT 9
- Docs: Confusion between resource and data managers HOT 1
- Still possible to join aborted and doomed transactions
- RTD integration broken HOT 2
- Remove legacy functionality from ITransactionDeprecated
- transaction 3.0 breaks afterCommitHooks HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from transaction.