Skip to content

Fix deadlock when an entry group's state channel is full - #558

Merged
arnested merged 1 commit into
arnested:mainfrom
achton:fix/drain-entry-group-state
Oct 20, 2026
Merged

arnested merged 1 commit into
arnested:mainfrom
achton:fix/drain-entry-group-state

Conversation

@achton

@achton achton commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

ldddns did not read go-avahi's StateChangeChannel. The channel holds 10 state changes, and each restart of a container adds about three. When the channel of one entry group is full, go-avahi v1.0.1 blocks while it holds the server lock. At the next new container, ldddns then stops. It does not publish or remove names, and it ignores SIGTERM until systemd kills it. This is probably the deadlock that #480 added logging for.

This PR bumps go-avahi to v1.1.0, which sends signals without the lock. It also reads the state channel of each entry group and logs collisions and failures as warnings.

To reproduce the problem on main:

  1. Start a container with VIRTUAL_HOST.
  2. Run docker restart on the container three times.
  3. Start a second container. Its name does not resolve.

ldddns did not read StateChangeChannel. The channel holds 10 state changes, and each restart of a container adds about three. When the channel is full, go-avahi v1.0.1 blocks while it holds the server lock. At the next new container, ldddns then stops and ignores SIGTERM.

Bump go-avahi to v1.1.0, which sends signals without the lock. Read the state channel of each entry group, and log collisions and failures as warnings.

Assisted-by: Claude
Signed-off-by: Achton Smidt Winther <achton@reload.dk>
@arnested
arnested merged commit ffbc40e into arnested:main Oct 20, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants