Move Other HttpUtils to use HttpClient#8390
Conversation
f406acd to
5d2f2ef
Compare
5d2f2ef to
c48b7b5
Compare
Codecov Report
@@ Coverage Diff @@
## master #8390 +/- ##
=============================================
- Coverage 70.79% 27.49% -43.31%
=============================================
Files 1654 1643 -11
Lines 86464 86387 -77
Branches 13037 13037
=============================================
- Hits 61216 23749 -37467
- Misses 21013 60404 +39391
+ Partials 4235 2234 -2001
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
f9bd3fc to
e4bdd9c
Compare
e4bdd9c to
db16a75
Compare
db16a75 to
68f7f22
Compare
- sleep for 1s for controller to restart in restart controller tests - change check FileNotFoundException to check status code 404 - fix reloadSegment/Table
905036f to
8813316
Compare
3976a3b to
fa65207
Compare
pinot-common/src/main/java/org/apache/pinot/common/utils/http/HttpClient.java
Outdated
Show resolved
Hide resolved
pinot-controller/src/test/java/org/apache/pinot/controller/helix/ControllerTest.java
Outdated
Show resolved
Hide resolved
| stopController(); | ||
| startController(properties); | ||
| // wait for controller to start correctly. | ||
| Thread.sleep(1000); |
There was a problem hiding this comment.
Do you run into issues without this wait? We should avoid using this kind of wait to get instance ready as this can be flaky
There was a problem hiding this comment.
yeah. for some unknown reason this test will fail if I dont wait. i can do a "TestUtils.waitUntilCondition" instead.
There was a problem hiding this comment.
Let's check what is causing the flakiness, and use TestUtils.waitUntilCondition to guard that condition
There was a problem hiding this comment.
i think we just need to make sure the HTTPServer is up . see my change
There was a problem hiding this comment.
Why is the HTTP server still not ready when the start controller already returns? IMO it should be ready during the start
There was a problem hiding this comment.
this I have no idea. the error simply said
Mar 28, 2022 6:31:51 PM org.glassfish.grizzly.http.server.NetworkListener shutdownNow
INFO: Stopped listener bound to [0.0.0.0:18998]
Mar 28, 2022 6:31:52 PM org.glassfish.grizzly.http.server.NetworkListener start
INFO: Started listener bound to [0.0.0.0:18998]
Mar 28, 2022 6:31:52 PM org.glassfish.grizzly.http.server.HttpServer start
INFO: [HttpServer-1] Started.
org.apache.http.NoHttpResponseException: localhost:18998 failed to respond
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:141)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:56)
at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259)
at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:163)
at org.apache.http.impl.conn.CPoolProxy.receiveResponseHeader(CPoolProxy.java:157)
at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273)
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:272)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
...
at org.apache.pinot.common.utils.http.HttpClient.sendJsonPutRequest(HttpClient.java:257)
at org.apache.pinot.controller.helix.ControllerRequestClient.updateTableConfig(ControllerRequestClient.java:100)
at org.apache.pinot.controller.helix.ControllerTest.updateTableConfig(ControllerTest.java:540)
at org.apache.pinot.controller.helix.core.minion.PinotTaskManagerStatelessTest.testPinotTaskManagerSchedulerWithRestart(PinotTaskManagerStatelessTest.java:180)
we should separately investigate the issue IMO
There was a problem hiding this comment.
@walterddr can you create an issue to track the above ? I think we can merge this
follow up on #8329 .
Description
We still have several http utils in the codebase that we should migrate to use the new HttpClient. This PR moves:
TODO
After this PR there are still some utilities that directly uses java.net.* or apache.http.* without an HttpUtils class. which we can migrate later.