Re: relayd: log errors before dropping a control connection

Rafael Sadowski <[email protected]> Wed, 5 Aug 2026 19:57:15 +0200
Newsgroups gmane.os.openbsd.tech
Message-ID <[email protected]>
On Sun Aug 02, 2026 at 10:45:59PM +0200, Claudio Jeker wrote:
> On Sun, Aug 02, 2026 at 09:32:20PM +0200, Rafael Sadowski wrote:
> > The control dispatcher silently closed the client connection when
> > imsgbuf_write or imsgbuf_get failed. A relayctl user then saw the
> > command break with no hint why, and nothing in the server log if we want
> > to debug it.
> > 
> > OK?
>  
> I don't think this is very helpful. It does not add any actionable value
> to the debug output.
> 
> imsgbuf_get() should simply never fail. It only fails if imsgbuf_read very
> much fucked up big time and returned an imsg that is shorter than the imsg
> header. imsgbuf_get() returns the failure since it can not do anything
> else (apart from ignoring errors which probably sucks more).
> 
> imsgbuf_write() mostly fails if the connection is closed. This is normally
> when the client (relayctl) is killed or exits. I doubt you gain much from
> such an error. Now doing something similar in the ctl program is a
> different story.
> 

Thanks, for the imsg information. In that case, those really don't make
sense. As for the others, I'm still waiting for review and okay.

Rafael