jbonofre commented on code in PR #1506:
URL: https://github.com/apache/arrow-java/pull/1506#discussion_r4626540036
##########
flight/flight-core/src/main/java/org/apache/arrow/flight/auth/ClientAuthWrapper.java:
##########
@@ -84,15 +87,17 @@ public void onNext(HandshakeResponse value) {
@Override
public byte[] next() {
- while (!completed.isDone() || !messages.isEmpty()) {
- byte[] bytes = messages.poll();
- if (bytes == null) {
- // busy wait.
- continue;
- } else {
- return bytes;
- }
+ final byte[] bytes;
+ try {
+ bytes = messages.take();
+ } catch (InterruptedException e) {
Review Comment:
When `take()` is interrupted, this exception exits `doClientAuth` before the
outbound handshake stream is completed or cancelled. The server can remain
blocked waiting for a client message.
I would signal an error on the request stream before propagating the
interruption.
--
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]