The response of sendNotification may not fulfill
See original GitHub issueHi jchambers,
I thought I found another issue. Please take some time to review it when you are available.
It seems the response promise for sendNotification may stay in unfinished state forever when write failure occurs here or here. Because there’s no listener on writePromise
to pass any exceptions it got to responsePromise
.
I think maybe we can fix this by changing the block start at line 214 in ApnsClient to:
channel.writeAndFlush(responsePromise).addListener(new GenericFutureListener<ChannelFuture>() {
@Override
public void operationComplete(final ChannelFuture future) throws Exception {
if (future.isSuccess()) {
ApnsClient.this.metricsListener.handleNotificationSent(ApnsClient.this, notificationId);
} else {
responsePromise.tryFailure(future.cause());
}
}
});
And removes the tryFailure
here.
What do you think?
Sorry for not taking PR right now because I may be missing something. So if you agree with the modifications above, I would love to take a PR as soon as possible.
By the way, my enviroment is : jdk: 1.8.0_192 pushy: 0.13.10 netty: 4.1.37.Final tcnative: netty-tcnative-boringssl-static-2.0.25.Final-linux-x86_64
Thanks.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (5 by maintainers)
Top GitHub Comments
I’ve opened #742, which should fix this issue. Your feedback is welcome and greatly appreciated!
At a quick glance, I think you may be right. I’ll analyze the situation more carefully as soon as I can. Thanks kindly for the report!