pushy icon indicating copy to clipboard operation
pushy copied to clipboard

Add request timeout

Open pertu opened this issue 3 years ago • 0 comments

The problem: in case of network failures some requests get stuck until the APNS connection restores.

Steps to reproduce:

  1. Make multiple (1000 or so) simultaneous (push) requests.
  2. Break APNS connectivity (or shut down emulator).
  3. Wait for a couple of minutes.
  4. Restore network (or start emulator).

At step (2) some futures complete with exception, but some get stuck until the (4) step.
With restored network those "stuck" futures complete as usual.

I guess throwing something like TimeoutException would be a more predicable/reliable behaviour.
Another option is apnsClient.send(...).orTimeout(...), but it may lead to resource leaks and it doesn't actually cancel the request.

Maybe related: #433 and #444 (drops write timeout).

What do you think about it?

pertu avatar Feb 03 '22 04:02 pertu