yihua opened a new pull request, #20881:
URL: https://github.com/apache/hudi/pull/20881

   ### Describe the issue this Pull Request addresses
   
   closes #20880
   
   The timeline server binds its port on the wildcard address, and the embedded 
service hands the driver host and that port to the write handles. A listener 
another process bound to a specific address (such as 127.0.0.1) takes the 
connections sent to that address ahead of the wildcard listener, and macOS 
hands a wildcard bind such a port, so every marker request of the write client 
can fail with a 404, an invalid HTTP response, or a read timeout. It shows up 
as a rare marker failure in a random test that passes on a rerun.
   
   ### Summary and Changelog
   
   `TimelineService.startService(advertisedHost)` requests the root page 
through the advertised host after each start, and moves on to the next attempt 
of the existing retry loop, which takes another port, only when that request 
gets an HTTP response while the server's own root handler saw no request. No 
response (a read timeout, a reset, a refused connection), as from a slow or 
loaded host, keeps the port. `EmbeddedTimelineService` passes its host, while 
`startService()` without a host skips the check, so the standalone server is 
unchanged. A restart within the loop also stops the request handler of the 
server it replaces. A new `TestTimelineService` case holds a port with an HTTP 
listener on the loopback address and creates a marker through the returned port 
(without the check it fails on macOS with `HttpResponseException: status code: 
404`), and another holds it with a listener that never answers and checks the 
server keeps the port.
   
   ### Impact
   
   One local HTTP request per embedded timeline server start. No API change for 
the standalone server.
   
   ### Risk Level
   
   low. The check only moves the server to another port when another HTTP 
listener answers at the advertised host and the server saw no request.
   
   ### Documentation Update
   
   none
   
   ### Contributor's checklist
   
   - [ ] Read through [contributor's 
guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [ ] Enough context is provided in the sections above
   - [ ] Adequate tests were added if applicable
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to