unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Attila Lendvai <attila@lendvai.name>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: [shepherd] several patches that i deem ready
Date: Thu, 18 Apr 2024 12:15:14 +0000	[thread overview]
Message-ID: <ZpZH2LrJhIOw4RslYLK3TOlPL16HShQ_e6_qEitjFLQ1tv48-s25HYscW6IcloUdBh8h8Nz3LPPBSlSTobtfIme1JGxH8-DS4mD8HAYrG4c=@lendvai.name> (raw)
In-Reply-To: <87a5m1i3fl.fsf@gnu.org>

hi Ludo,


> > i have prepared the rest of my commits that were needed to hunt down the shepherd hanging bug. you can find them at:
> > 
> > https://codeberg.org/attila-lendvai-patches/shepherd/commits/branch/attila
> > 
> > there's some dependency among the commits, so sending them to debbugs would be either as one big series of commits, or a hopeless labirinth of patches otherwise.
> 
> 
> Yes, but OTOH, piecemeal, focused changes sent to Debbugs are easier to
> review for me. (There are 34 commits in this branch touching different
> aspects.)


i understand that, but cutting out some of the commits from this branch is a lot of work at best, and not possible at worst due to semantic dependencies.

e.g. how shall i implement proper error handling without being able to inspect what's happening (i.e. proper logging)?

nevertheless, i'll rebase my work on the devel branch eventually. it will be a lot of pain in itself, but if i need to reimplement/rebase stuff by hand anyway, then i'll try to further sort the commits in a least-controversial order.


> I cherry-picked a couple of patches.
> 
> Some notes:
> 
> + 94c1143 shepherd: Add tests/startup-error.sh
> 
> Redundant with ‘tests/startup-failure.sh’ I think?


one of them just returns #f from its start lambda, while the new one throws an error. they exercise different code paths in shepherd.


> + e802761 service: Add custom printer for <service> records.
> 
> 
> Good idea, but the goal is to remove GOOPS, so put aside for now.


ok, i'll get rid of it (move it away into a local kludge branch). its main purpose is to be able to simply FORMAT some service objects into the log.


> + af2ebec service: respawn-limit: make #f mean no limit.
> 
> I’d rather not do that: one can use +inf.0 when needed.


i found the respawn-limit API somewhat confusing (it requires a cons cell with two numbers). i thought #f could be a simple way to disable the respawn limit; simple both in implementation and as an API.

FWIW, it's the first time i've ever met +inf.0

but as you wish, we can manage without this commit.


> + 095e930 shepherd: Do not respawn disabled services.
> 
> That’s already the case (see commit
> 7c88d67076a0bb1d9014b3bc23ed9c68f1c702ab; maybe we hacked it
> independently in parallel).


err, hrm... i'm not sure anymore why i created that commit.

"Respawning ~a." is printed before calling START-SERVICE (that then does honor the ENABLED? flag). maybe i recorded this commit without actually checking whether the service is respawned (as opposed to merely printing an inert log message).

i'll get rid of this, but the incorrect respawning message will remain a source of confusion.


> + dbc9150 shepherd: Increase the time range for the default respawn limit.
> 
> This arbitrary and thus debatable, but I think the current setting
> works well, doesn’t it?


the current limit will not catch services whose start-to-fail time is not in the ballpark of 1 sec (5 times in 7 seconds).

the startup-to-fail time of the service i'm working with is way above 1 sec.


> + e03b958 support: Add logging operators.
> + 39c2e14 shepherd: add call-with-error-handling
> 
> I like the idea: we really need those backtraces to be logged!
> There are mostly-stylistic issues that would need to be discussed
> though. I’d like logging to be less baroque; I’m not convinced by:


what do you mean by 'baroque' here? too verbose in the source code?


> + 7183c9c shepherd: Populate the code with some log lines.
> 
> This is exactly what I’d like to avoid—adding logging statements all
> around the code base, possibly redundant with existing logging
> statements that target users.
> 
> What I do want though is to have “first-class logs”, pretty much like
> what we see with ‘herd log’ etc. To me, that is much more useful than
> writing the arguments passed each and every ‘fork+exec-command’ call.


don't they serve two entirely different purposes?

1) logs meant for the users of shepherd (aka herd log)

vs

2) logs that the shepherd and service developers need to understand shepherd's temporal behavior.


i added every logging related code in the various pursuits of hunting down specific bugs.

1. bug gets triggered
2. stare at logs, have some questions
3. add some more log statements
4. goto 1.

i'm not aware of any way to efficiently inspect the temporal behavior of a codebase other than adding explicit log statements. ideally using multiple, hierarchical log categories that can be turned on and off separately, both at runtime and at compile time.

what i added to shepherd is a super simplified, local, mock version of that (short of porting/finding a proper logging library in scheme).


> I’ll have to look further that branch. I admit I have limited bandwidth
> available and, perhaps selfishly, I like to use my free-time computing
> to hack myself.


it is of course your call how you make a tradeoff between building/fixing things by yourself, and spending your time on external contributions.

note though that such decisions will fundamentally influence the path the project takes. and often it's an unseen influence in the form of contributions that could have manifested, but in the end did not manifest.

the input i can give here is that it would be dismaying for a contributor like me to see a oneliner bugfix get accepted, while the entire work that was needed for finding that bug remains ignored (and be unavailable when looking for the next bug, or remain in a local branch that regularly takes up a lot of time to rebase).

and the icing on the cake here is that many people, who are not enthusiastic enough, would not even complain. they just quietly chose not to contribute.

this ties back into other discussions about the use of debbugs, the bandwidth issues around contributions, the various demands like the changelog format in commit messages, what is seen and what is not seen (Bastiat reference), etc.


> Regardless, I’d like to thank you for your continued efforts on the
> Shepherd. In one way or another, it contributes to shaping it.


my pleaseure. and thank you for creating/maintaining shepherd! it's a lot of fun to work with, and it makes things possible that i wouldn't even try in e.g. NixOS (where i have arrived from).

-- 
• attila lendvai
• PGP: 963F 5D5F 45C7 DFCD 0A39
--
“[…] without children and old people mixing in daily life a community has no future and no past, only a continuous present.”
	— John Taylor Gatto (1935–2018), 'Teacher of the Year Acceptance Speech'



      reply	other threads:[~2024-04-18 12:16 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-18 23:38 [shepherd] several patches that i deem ready Attila Lendvai
2024-01-21  9:38 ` Attila Lendvai
2024-01-21 17:49   ` Maxim Cournoyer
2024-01-22 18:38     ` Attila Lendvai
2024-01-23 13:21       ` Maxim Cournoyer
2024-01-24 10:56         ` Attila Lendvai
2024-01-24 13:56           ` Maxim Cournoyer
2024-01-24 16:41             ` Zheng Junjie
2024-01-24 19:23               ` Maxim Cournoyer
2024-01-24 17:11 ` Attila Lendvai
2024-01-26  9:50   ` [OT: s/Joshua/Josiah/ in sig ;-] " bokr
2024-01-26 21:50     ` [OT: s/Joshua/Josiah/ in sig ; -] " Attila Lendvai
2024-04-02 10:43 ` Attila Lendvai
2024-04-10 16:32 ` Ludovic Courtès
2024-04-18 12:15   ` Attila Lendvai [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='ZpZH2LrJhIOw4RslYLK3TOlPL16HShQ_e6_qEitjFLQ1tv48-s25HYscW6IcloUdBh8h8Nz3LPPBSlSTobtfIme1JGxH8-DS4mD8HAYrG4c=@lendvai.name' \
    --to=attila@lendvai.name \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).