Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

async_exec never returns with server down #199

Closed
strelez77 opened this issue May 8, 2024 · 3 comments
Closed

async_exec never returns with server down #199

strelez77 opened this issue May 8, 2024 · 3 comments

Comments

@strelez77
Copy link

strelez77 commented May 8, 2024

Hi,
I use ping command to check both the connection and the server health. The redis client health check is disabled in this case. In case the redis server goes down, the next happens:

  • first ping throws an exception. will_reconnect returns true.
  • second ping (sent in a second) never returns from async_exec

If I remember correctly, with Boost 1.84, I was able to ping infinitely, causing an exception. Once the server was back up and the connection was restored, the pings started returning true. My intention is to restart the server after several failures.
It does not reproduce always and I have a workaround with timed operation, so it is not a critical for me. Here are the details in any case.

My env:
Windows 64
Target build 32 bit
boost version 1.85

Here is the redis log in debug from the point the server goes down:
(Boost.Redis) reader-op: (Boost.Redis) reader-op: An existing connection was forcibly closed by the remote host
(Boost.Redis) reader-op: error. Exiting ...
An existing connection was forcibly closed by the remote host(Boost.Redis) reader-op: An existing connection was forcibly closed by the remote host
(Boost.Redis) reader-op: error. Exiting ...

(Boost.Redis) writer-op: canceled (3). Exiting ...
(Boost.Redis) reader-op: error. Exiting ...
(Boost.Redis) run-op: (Boost.Redis) writer-op: canceled (3). Exiting ...An existing connection was forcibly closed by the remote host (reader),
The operation completed successfully (writer)
(Boost.Redis) runner-op: (Boost.Redis) An existing connection was forcibly closed by the remote host (async_run_all), run-op: The operation completed successfully (async_health_check) An existing connection was forcibly closed by the remote host (reader), The operation completed successfully (async_hello).The operation completed successfully (writer)

(Boost.Redis) Connection lost: An existing connection was forcibly closed by the remote host
(Boost.Redis) writer-op: canceled (3). Exiting ...
(Boost.Redis) run-op: An existing connection was forcibly closed by the remote host (reader), The operation completed successfully (writer)
(Boost.Redis) check-health-op: timeout disabled.
(Boost.Redis) run-all-op: resolve addresses 127.0.0.1:6379, [::1]:6379
(Boost.Redis) check-timeout-op: Response has no value. Exiting ...
(Boost.Redis) ping_op: error/cancelled (1).
(Boost.Redis) check-health-op: The I/O operation has been aborted because of either a thread exit or an application request (async_ping), Pong timeout. (async_check_timeout).
(Boost.Redis) runner-op: An existing connection was forcibly closed by the remote host (async_run_all), Pong timeout. (async_health_check) The operation completed successfully (async_hello).
(Boost.Redis) Connection lost: An existing connection was forcibly closed by the remote host
(Boost.Redis) check-timeout-op: Response has no value. Exiting ...
(Boost.Redis) ping_op: error/cancelled (1).
(Boost.Redis) check-health-op: The I/O operation has been aborted because of either a thread exit or an application request (async_ping), Pong timeout. (async_check_timeout).
(Boost.Redis) runner-op: An existing connection was forcibly closed by the remote host (async_run_all), Pong timeout. (async_health_check) The operation completed successfully (async_hello).
(Boost.Redis) Connection lost: An existing connection was forcibly closed by the remote host
(Boost.Redis) run-all-op: resolve addresses (Boost.Redis) run-all-op: resolve addresses 127.0.0.1:6379, 127.0.0.1:6379[::1]:6379
, [::1]:6379
(Boost.Redis) run-all-op: connected to endpoint No connection could be made because the target machine actively refused it

(Boost.Redis) (Boost.Redis) check-timeout-op: Response has no value. Exiting ...check-timeout-op: Response has no value. Exiting ...
(Boost.Redis)
ping_op: error/cancelled (1).(Boost.Redis) ping_op: error/cancelled (1).

(Boost.Redis) (Boost.Redis) check-health-op: check-health-op: The I/O operation has been aborted because of either a thread exit or an application request (async_ping), The I/O operation has been aborted because of either a thread exit or an application request (async_ping), Pong timeout. (async_check_timeout).Pong timeout. (async_check_timeout).

(Boost.Redis) run-all-op: connected to endpoint (Boost.Redis) run-all-op: connected to endpoint No connection could be made because the target machine actively refused it
No connection could be made because the target machine actively refused it

@mzimbres
Copy link
Collaborator

mzimbres commented May 9, 2024

Do you have some code I could use to reproduce the problem?

@strelez77
Copy link
Author

I'll check if I can come up with something.

@VemundH
Copy link

VemundH commented Jul 26, 2024

@strelez77 try to set cancel_if_not_connected = true in your ping requests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants