"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Omar Polo <op@omarpolo.com>
Subject:
Re: gotwebd: use less temp files
To:
Stefan Sperling <stsp@stsp.name>
Cc:
gameoftrees@openbsd.org
Date:
Mon, 27 May 2024 12:11:12 +0200

Download raw body.

Thread
On 2024/05/27 11:20:37 +0200, Stefan Sperling <stsp@stsp.name> wrote:
> On Sat, May 25, 2024 at 06:45:52PM +0200, Omar Polo wrote:
> > for gotwebd we allocate a whole set of temp fd per listening socket.
> > since we only process one request at a time, we can instead use only
> > a global set of fds.
> > 
> > i have this running on my instance.
> > 
> > ok?
> 
> It is possible for multiple clients to remain connected in parallel.

not really *

> So can we be really sure there's no possibility of overlapping use
> of files between clients, depending on how the kernel/libevent make
> gotwebd run through its various code paths?

gotwebd is synchronous **

Once we enter gotwebd_process_request() in fcgi.c:193 we don't exit
until all the reply has been created.

This is by design, we don't have async APIs for the various got
operations.

* and **: the fastcgi parsing code is kind of asynchronous, and that's
the only part.  Once we enter the got machinery it's all blocking.

> I do recall bugs when gotwebd had cached repositories were some requests
> were returning spurious errors after some unexpected file descriptor
> behaviour, usually unexpected EOF.
> This hasn't happened again ever since the repository cache was removed.
> There was likewise only one set of temp fds associated with a repo which
> was used to serve multiple requests.
> Is this diff not recreating this problem?

No.  The problem with the cache was that we kept some repos opened while
processing other stuff.  Now we just keep one repo alive at a time, and
this diff isn't changing it.