coreos / coreos/go-systemd

systemd unit dbus subscriptions should use unit events.

Open
#229 2 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
2.7k
Forks
338
PR merge metrics
No merged PRs in 30d

Description

Basically this TODO needs to be implemented:

func (s *SubscriptionSet) Subscribe() (<-chan map[string]*UnitStatus, <-chan error) {
	// TODO: Make fully evented by using systemd 209 with properties changed values
	return s.conn.SubscribeUnitsCustom(time.Second, 0,
		mismatchUnitStatus,
		func(unit string) bool { return s.filter(unit) },
	)
}

can't accurately monitor units being restarted without calling SubscribeUnitsCustom with a very short delay. which wastes a bunch of cpu.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at SubscriptionSet.Subscribe and the current SubscribeUnitsCustom call. Read the systemd 209 unit-events and PropertiesChanged behavior to understand how unit status changes should be delivered without short polling. Done means restarts are monitored accurately through unit events while avoiding the current CPU-heavy delay-based subscription.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
operating-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.