Skip to content

feat(network): replace polling with D-Bus signal subscription#191

Merged
JanZachmann merged 5 commits intoomnect:mainfrom
JanZachmann:feat/networkd-signal-subscription
Feb 24, 2026
Merged

feat(network): replace polling with D-Bus signal subscription#191
JanZachmann merged 5 commits intoomnect:mainfrom
JanZachmann:feat/networkd-signal-subscription

Conversation

@JanZachmann
Copy link
Contributor

@JanZachmann JanZachmann commented Feb 23, 2026

Summary

  • Subscribe to org.freedesktop.network1 D-Bus signals via zbus::MessageStream::for_match_rule instead of polling networkd_interfaces() every 60 seconds
  • A 2-second debounce window coalesces signal bursts (e.g. DHCP negotiation) into a single report() call
  • Remove the post-reload fixed delay (RELOAD_NETWORK_DELAY_MS) — signals fired by networkd as it applies config changes make it redundant
  • Mock path retains the interval-based approach unchanged

@JanZachmann JanZachmann force-pushed the feat/networkd-signal-subscription branch 2 times, most recently from e47220e to 5b6d42f Compare February 24, 2026 07:51
Subscribe to org.freedesktop.network1 signals via zbus::MessageStream
instead of polling networkd every 60 seconds. A 2-second debounce window
coalesces bursts (e.g. DHCP negotiation) into a single report call.

The background task self-terminates when the receiver is dropped on
shutdown, and is also aborted when Network is dropped via the stored
JoinHandle. Mock path retains the interval-based approach unchanged.

Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>
Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>
With D-Bus signal subscription the delay after ReloadNetwork is no
longer needed: networkd emits PropertiesChanged signals as it applies
the new config, which triggers a debounced report automatically.

Also remove the RELOAD_NETWORK_DELAY_MS env var and update README.

Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>
Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>
…ments

Remove redundant "network:" prefix from signal task log messages to
match the function-context style used elsewhere in this module.

Add comments explaining the debounce rationale and the FAR_FUTURE
placeholder required by tokio::select!'s unconditional future evaluation.

Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>
@JanZachmann JanZachmann force-pushed the feat/networkd-signal-subscription branch from 5b6d42f to f9e0304 Compare February 24, 2026 07:53
@JanZachmann JanZachmann requested a review from mlilien February 24, 2026 07:54
@JanZachmann JanZachmann merged commit 197adc7 into omnect:main Feb 24, 2026
3 checks passed
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.

2 participants