[GH-ISSUE #90] Spotipy Object is not threadsafe with respect to request sessions and connection pools #40

Closed
opened 2026-02-27 23:20:32 +03:00 by kerem · 3 comments
Owner

Originally created by @jdwilkin on GitHub (Apr 15, 2016).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/90

When a single Spotipy object is used in multiple threads talking to the same endpoint, depending on timing, connection pool closed errors can occur. This happens because after every request made in _internal_call "close" is called on the request connection which in turn closes the session's pool for that end point. If another thread has already come in and been given a reference to that pool then tries to use it later, it will get this pool closed exception

Originally created by @jdwilkin on GitHub (Apr 15, 2016). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/90 When a single Spotipy object is used in multiple threads talking to the same endpoint, depending on timing, connection pool closed errors can occur. This happens because after every request made in _internal_call "close" is called on the request connection which in turn closes the session's pool for that end point. If another thread has already come in and been given a reference to that pool then tries to use it later, it will get this pool closed exception
kerem closed this issue 2026-02-27 23:20:33 +03:00
Author
Owner

@jdwilkin commented on GitHub (May 12, 2016):

after going through the pull requests it seems there is already one that addresses this, (at least it appears to) #68

<!-- gh-comment-id:218864943 --> @jdwilkin commented on GitHub (May 12, 2016): after going through the pull requests it seems there is already one that addresses this, (at least it appears to) #68
Author
Owner

@shillshocked commented on GitHub (Oct 23, 2019):

Yeah, it's still an issue. This repo doesn't seem to be properly maintained any more as pull requests aren't being honored.

<!-- gh-comment-id:545673621 --> @shillshocked commented on GitHub (Oct 23, 2019): Yeah, it's still an issue. This repo doesn't seem to be properly maintained any more as pull requests aren't being honored.
Author
Owner

@stephanebruckert commented on GitHub (Jan 17, 2020):

Hey @shillshocked, @jdwilkin, thanks for reporting this. The package is maintained again, any chance you can create a new PR?

<!-- gh-comment-id:575753233 --> @stephanebruckert commented on GitHub (Jan 17, 2020): Hey @shillshocked, @jdwilkin, thanks for reporting this. The package is maintained again, any chance you can create a new PR?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotipy#40
No description provided.