Arawoof06 opened a new pull request, #1506:
URL: https://github.com/apache/arrow-java/pull/1506

   ## What's Changed
   
   `ServerAuthWrapper` gives the legacy `ServerAuthHandler` an iterator whose 
`next()` spins on `LinkedBlockingQueue.poll()` until the client sends a 
handshake message or closes the stream. `ServerAuthInterceptor` lets Handshake 
through without a token, so on a server configured with a legacy handler such 
as `BasicServerAuthHandler`, an unauthenticated client can open Handshake 
streams, send nothing, and keep one executor thread per stream at full CPU for 
as long as the stream stays open. `ClientAuthWrapper` spins the same way on the 
client while waiting for the server's reply.
   
   `next()` now blocks on `take()`. `onCompleted`/`onError` enqueue an 
end-of-stream marker so a waiting reader wakes up and throws the same 
exceptions as before, and `hasNext()` ignores the marker. Valid handshakes are 
unaffected.
   
   Measured against a `FlightServer` with `BasicServerAuthHandler`, with 4 
Handshake streams opened and left idle for 3 s:
   
   ```
   before: wall=3.04s, server executor CPU=8.09s
   after:  wall=3.03s, server executor CPU=0.01s
   ```
   
   `TestBasicAuth.handshakeBlocksWhileWaitingForClient` opens an idle Handshake 
and checks that the server thread is `WAITING`. It fails without the fix 
(`expected: <WAITING> but was: <RUNNABLE>`). The flight-core tests pass with 
the fix.
   


-- 
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