akalash commented on pull request #17440:
URL: https://github.com/apache/flink/pull/17440#issuecomment-943469088
I don't really sure about this proposal because we already create the client
via clientBuilder, and then, by some reason, we need to wait on a future before
the call of the one particular method. It looks pretty fragile because if
tomorrow we will add one more method like that we will need to duplicate this
waiting.
In my opinion, the problem is returning the unprepared client. I mean, in
fact, when we create the PartitionRequestClient we can not use it as is but we
should wait while it will be ready which seems wrong. At the same time, I agree
with you that at least we can safely call requestPartition method without
waiting for channel initialization.
So at least right now, I see two solutions:
- Separating PartitionRequestClient into two classes one of them for
requestPartiton while another for other things(this change looks pretty
expensive and I don't think that it makes sense now)
- Adding waiting for channel activation inside every methods that use the
context:
```
Context receiveContext() {
If(ctx == null) {
channelActivationFuture.get();
}
return ctx;
}
void announceBufferSize(int bufferSize) {
Context ctx = receiveContext();
ctx.....
}
```
Only one open question for this solution - how to handle the
interruptedException which is not typical for this place right now.
I will try to come up with other ideas.
--
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]