Repository navigation
humd: autoupdate outlives the humd it restarts, and the thrum probe stops saying hello - #111
Merged
Merged
Conversation
humd ran the installer as its own child, in its own process group. The installer's `launchctl bootout gui/$uid/humd` killed that whole group, installer included, so it never reached `launchctl bootstrap` and humd stayed down until someone reinstalled by hand. The installer now leads its own process group, so the bootout spares it. On Linux, systemd stops the unit's whole cgroup either way, but `systemctl --user restart` is a single job, so humd came back there already.
…aying hello `hum doctor` and `humctl health` sent a bare hello, which humd refused and logged at ERROR (`thrum.hello.proto-missing`). Adding protoVersion would only move the refusal to the hive check, which also logs at ERROR, and a hello that passed every check would nestle the probe as a bee. humd already breathes to every connection before any hello, and that breath was the reply the probe read. The probe now connects and waits for it, sending nothing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two bugs that leave a humd looking down when it isn't, or down when it should be up.
Autoupdate left humd stopped. When
autoupdate_check_oncefound a newer release, it ran the installer as humd's own child, in humd's process group. The installer'slaunchctl bootout gui/$uid/humdkills the job's whole process group, so it killed the installer too, before the installer reachedlaunchctl bootstrap. humd stayed down until someone reinstalled by hand, every bee lost its kernel, andhum doctorshowed the thrum socket refusing connections. The installer now leads its own process group (installer_outliving_humd,process_group(0)), so the bootout spares it.systemctl --user restartis one job that systemd finishes even after the installer is killed, so humd already came back there. Only the installer's last log lines are lost.The thrum probe logged a false ERROR.
hum doctor(probe_thrum) andhumctl healthsent{"chi":"hello","sid":…}with noprotoVersion. humd refused it and loggedthrum.hello.proto-missingat ERROR on every run, and the probe still printed ✓ live. AddingprotoVersionwould not fix it:thrum.hello.hive-unrecognised).humd breathes to every connection before any hello (
thrumd/conn.rs), and that breath was the reply the probe was already reading. So the probe now connects, sends nothing, and waits up to 1s for the breath. humd is unchanged.a_connection_is_heard_only_once_its_hello_is_admittedalready requires that breath, which is the contract the probe now leans on.Verified.
the_installer_leads_its_own_process_group_so_a_bootout_of_humd_spares_itruns the installer's command and checks that its pid is its own pgid.tools/speech.pypasses.hum doctorandhumctl healthboth said ✓ live. humd logged onlythrum.connectedandthrum.disconnectedfor each, with no hello and no ERROR.