Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I ran into the thread safety issue described here: #153 According to boto3's docs, each thread should have its own session instance: http://boto3.readthedocs.io/en/latest/guide/resources.html#multithreading I resolved this by modifying the session property on the connection class. It makes self._session into a thread local variable, and attaches a session to self._session.session. The session property still has the same behavior, but now it's creating a session on a per-connection-per-thread basis instead of just on a per-thread basis. This issue was intermittent to begin with, and I hadn't figured out a way to reliably reproduce it, or I would have written a test. It still passes PynamoDB's unit tests, and I haven't run into the thread safety issue described in #153 since I've been running the patched version.
- Loading branch information