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

haproxy: implement sd_notify for mworker mode #41

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wlallemand
Copy link
Contributor

With the previous implementation of the haproxy mworker mode, VTest was waiting for the pidfile to be created to start the tests. From time to time it was causing issues, because the pidfile could be ready before haproxy is completely ready. With haproxy 3.1 and the new master-worker model this is even worse, because the pidfile is created before parsing the configuration, so haproxy is never ready.

This patch implements the -Ws mode of haproxy, which was initially made to support the sd_notify API of systemd. This mode sends READY=1 message over a SOCK_DGRAM unix socket once haproxy is completely ready. In order to receive the message, VTest binds on a UNIX sockets and stores the path of this socket in the NOTIFY_SOCKET environment variable. Once the message is received, VTest will start the tests.

With the previous implementation of the haproxy mworker mode, VTest was
waiting for the pidfile to be created to start the tests. From time to
time it was causing issues, because the pidfile could be ready before
haproxy is completely ready. With haproxy 3.1 and the new master-worker
model this is even worse, because the pidfile is created before parsing
the configuration, so haproxy is never ready.

This patch implements the -Ws mode of haproxy, which was initially made
to support the sd_notify API of systemd. This mode sends READY=1 message
over a SOCK_DGRAM unix socket once haproxy is completely ready.
In order to receive the message, VTest binds on a UNIX sockets and
stores the path of this socket in the NOTIFY_SOCKET environment
variable. Once the message is received, VTest will start the tests.
@wlallemand
Copy link
Contributor Author

mergeable now, lacked a minor fix

haproxy-mirror pushed a commit to haproxy/haproxy that referenced this pull request Nov 20, 2024
Build VTest temporarily from the sd-notify PR until the
vtest/VTest#41 is merged.

This PR allows starting with -Ws in order to have more reliables tests
in master-worker mode.
haproxy-mirror pushed a commit to haproxy/haproxy that referenced this pull request Nov 20, 2024
Build VTest temporarily from the sd-notify PR until the
vtest/VTest#41 is merged.

This PR allows starting with -Ws in order to have more reliables tests
in master-worker mode.
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

Successfully merging this pull request may close these issues.

1 participant