-
Notifications
You must be signed in to change notification settings - Fork 260
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
HttpProtocol (both okhttp and apache) race condition while having different proxies in different threads #1247
Comments
thanks @chhsiao90, are you able to suggest a fix for it? |
Sure, I can have a PR for it. |
chhsiao90
added a commit
to chhsiao90/incubator-stormcrawler
that referenced
this issue
Jul 8, 2024
In HttpProtocol implementation, the client builder was singleton and may be accessed and modified by different threads at same time. The result is that a wrong proxy will be used or a wrong proxy auth will be configured. To fix it, create a local builder insteand of having a field-level builder. Fixes apache#1247
10 tasks
chhsiao90
added a commit
to chhsiao90/incubator-stormcrawler
that referenced
this issue
Jul 8, 2024
In HttpProtocol implementation, the client builder was singleton and may be accessed and modified by different threads at same time. The result is that a wrong proxy will be used or a wrong proxy auth will be configured. To fix it, create a local builder insteand of having a field-level builder. Fixes apache#1247
chhsiao90
added a commit
to chhsiao90/incubator-stormcrawler
that referenced
this issue
Jul 15, 2024
In HttpProtocol implementation, the client builder was singleton and may be accessed and modified by different threads at same time. The result is that a wrong proxy will be used or a wrong proxy auth will be configured. To fix it, create a local builder insteand of having a field-level builder. Fixes apache#1247
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What kind of issue is this?
Question. This issue tracker is not the best place for questions. If you want to ask how to do
something, or to understand why something isn't working the way you expect it to, use StackOverflow
instead with the label 'stormcrawler': https://stackoverflow.com/questions/tagged/stormcrawler
Bug report. If you’ve found a bug, please include a test if you can, it makes it a lot easier to fix things. Use the label 'bug' on the issue.
Feature request. Please use the label 'wish' on the issue.
Reproduce steps
To reproduce it, we can run the HttpProtocol main function with many urls with MultiProxyFactory
the crawler.conf
the proxies file
Root cause
The HttpProtocol (both okhttp and apache) is not thread-safe
Example 1 (wrong proxy auth)
Example 2 (wrong proxy used)
The text was updated successfully, but these errors were encountered: