-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Fix the thread safety problem of obtaining HttpRequestBase through BaseHttpMethod enumeration #3469
Conversation
这个好像没有解决吧!使用1.3.2仍然报错 |
报错?麻烦贴一下报错信息,或者贴一下到issue上 |
|
1.3.2 还是有 |
@wangdm0824 可以提供一下更详细的错误信息吗? |
ERROR [com.alibaba.nacos.client.naming.updater] com.alibaba.nacos.client.naming [,] - [NA] failed to request |
@wangdm0824 从错误信息看,可能是因为网络原因导致的连接超时。麻烦检查一下网络是否正常的 |
@Maijh97 应该不是,我的项目正常运行(服务注册、发现都没问题), 就是error.log文件中一直打印这个,其他使用都很正常 |
Please do not create a Pull Request without creating an issue first.
What is the purpose of the change
Since
HttpRequestBase
is an enum member attribute ofBaseHttpMethod
, when multiple threads call the init method at the same time, there will be thread safety issues.Thereby affecting the http client request.
fix: #3366, #3314
Brief changelog
Remove the
HttpRequestBase
member attribute from theBaseHttpMethod
enum, and return the instance directly through the init methodVerifying this change
XXXX
Follow this checklist to help us incorporate your contribution quickly and easily:
[ISSUE #123] Fix UnknownException when host config not exist
. Each commit in the pull request should have a meaningful subject line and body.mvn -B clean package apache-rat:check findbugs:findbugs -Dmaven.test.skip=true
to make sure basic checks pass. Runmvn clean install -DskipITs
to make sure unit-test pass. Runmvn clean test-compile failsafe:integration-test
to make sure integration-test pass.