Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PoolTimeout exceptions on requests to Tumblr #4

Closed
syeopite opened this issue Dec 3, 2023 · 5 comments · Fixed by #11
Closed

PoolTimeout exceptions on requests to Tumblr #4

syeopite opened this issue Dec 3, 2023 · 5 comments · Fixed by #11
Labels
bug Something isn't working

Comments

@syeopite
Copy link
Owner

syeopite commented Dec 3, 2023

Priviblur can sometimes stop working randomly due to a permanent pool timeout exception. Directly accessing Tumblr works as expected

This is most commonly seen in the media requests, meaning that all pages still works fine just without any media assets loaded. However, it seems like regular requests can also be affected resulting in a pool timeout exception page on all Priviblur routes.

It seems to be reproducible after extensive usage.

A restart is able to fix this.

More investigation needed.

@syeopite
Copy link
Owner Author

syeopite commented Dec 8, 2023

Related: encode/httpx#1171

@syeopite
Copy link
Owner Author

Seems like the problem is not just limited to media requests. The regular client used for requesting Tumblr's API seems to also be affected.

@syeopite
Copy link
Owner Author

According to the upstream issue, it seems like the problem is due to the fact that clients aren't released from the connection pool when the request is canceled.

Shielding the request from being canceled is reported as a workaround for the issue.

syeopite added a commit that referenced this issue Jan 4, 2024
#4 appears to be caused by
faulty connections that aren't properly released which will result in
a PoolTimeout exception when attempting to fetch one.

When enough of a pool gets poisoned, all requests will fail due to the
PoolTimeout exceptions.

This commit implements a workaround by detecting and then reinitializing
poisoned connection pools which would clear all of the faulty connections.
syeopite added a commit that referenced this issue Jan 4, 2024
#4 appears to be caused by
faulty connections that aren't properly released which will result in
a PoolTimeout exception when attempting to fetch one.

When enough of a pool gets poisoned, all requests will fail due to the
PoolTimeout exceptions.

This commit implements a workaround by detecting and then reinitializing
poisoned connection pools which would clear all of the faulty connections.
@syeopite syeopite changed the title Media requests to priviblur can sometimes freeze Requests to priviblur can sometimes freeze Jan 4, 2024
@syeopite syeopite changed the title Requests to priviblur can sometimes freeze PoolTimeout exceptions on requests to Tumblr Jan 4, 2024
@syeopite syeopite added the bug Something isn't working label Jan 7, 2024
syeopite added a commit that referenced this issue Jan 13, 2024
#4 appears to be caused by
faulty connections that aren't properly released which will result in
a PoolTimeout exception when attempting to fetch one.

When enough of a pool gets poisoned, all requests will fail due to the
PoolTimeout exceptions.

This commit implements a workaround by detecting and then reinitializing
poisoned connection pools which would clear all of the faulty connections.
@syeopite syeopite reopened this Jan 17, 2024
@syeopite
Copy link
Owner Author

Issue still seems to occur

@syeopite
Copy link
Owner Author

httpx has reportedly fixed the issue here encode/httpcore#880

It should be fine for us to switch back to httpx now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant