• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

jlafon / PynamoDB / 788
98%

Build:
DEFAULT BRANCH: devel
Ran 21 Feb 2017 10:51PM UTC
Jobs 5
Files 22
Run time 5min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
788

Pull #234

travis-ci

web-flow
Make sessions threadsafe

I ran into the thread safety issue described here:

https://github.com/jlafon/PynamoDB/issues/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.
Pull Request #234: Make sessions threadsafe

4830 of 4942 relevant lines covered (97.73%)

4.88 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
21
100.0
pynamodb/connection/base.py
Jobs
ID Job ID Ran Files Coverage
1 788.1 (AWS_SECRET_ACCESS_KEY=fake_key AWS_ACCESS_KEY_ID=fake_id) 21 Feb 2017 10:51PM UTC 0
97.51
Travis Job 788.1
2 788.2 (AWS_SECRET_ACCESS_KEY=fake_key AWS_ACCESS_KEY_ID=fake_id) 21 Feb 2017 10:55PM UTC 0
97.51
Travis Job 788.2
3 788.3 (AWS_SECRET_ACCESS_KEY=fake_key AWS_ACCESS_KEY_ID=fake_id) 21 Feb 2017 10:52PM UTC 0
97.55
Travis Job 788.3
4 788.4 (AWS_SECRET_ACCESS_KEY=fake_key AWS_ACCESS_KEY_ID=fake_id) 21 Feb 2017 10:57PM UTC 0
97.55
Travis Job 788.4
5 788.5 (AWS_SECRET_ACCESS_KEY=fake_key AWS_ACCESS_KEY_ID=fake_id) 21 Feb 2017 10:52PM UTC 0
97.55
Travis Job 788.5
Source Files on build 788
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #788
  • Pull Request #234
  • PR Base - devel (#787)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc