git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Fwd: Fwd: git-daemon access-hook race condition

From
ESEugene Sajine <euguess@gmail.com>
Date
Sep 12, 2013, 22:01 UTC
Message-ID
<CAPZPVFZHyzPZnyg5gjhL0tP6Kgd=XFLc6o8ZKsmPXLUSdcc5mA@mail.gmail.com>
In-Reply-To
<CAPZPVFYtVsPrFEMcx9UBQzJffi9tRduDqLfUF1vGR=WSKL95aQ@mail.gmail.com>
On Thu, Sep 12, 2013 at 5:16 PM, Eugene Sajine <euguess@gmail.com> wrote:
Show 42 quoted lines
> Junio,
>
> Thanks for the clarification! Your solution does look better.
>
> For now though i think i will have to delay the notification somehow
> and let the service finish first then notify the server.
>
> Thanks again!
>
> Eugene
>
>
> On Thu, Sep 12, 2013 at 5:08 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> Eugene Sajine <euguess@gmail.com> writes:
>>
>>> So are you really sure that it is a non-starter to have
>>> --before-service/--after-service options for access-hook?
>>
>> Given the definition of "--access-hook" in "git help daemon":
>>
>>     --access-hook=<path>::
>>             Every time a client connects, first run an external command
>>             specified by the <path> ... The external command can decide
>>             to decline the service by exiting with a non-zero status (or
>>             to allow it by exiting with a zero status)....
>>
>> There is *NO* way in anywhere --after-service makes any sense (and
>> by definition --before-service is redundant).
>>
>> What you _could_ propose is to define a *new* hook that is run when
>> the spawned service has returned, with the same information that is
>> fed to the access hook (possibly with its exit status).
>>
>> I do not offhand know if we retain the original service information
>> that long after the main daemon process has spawned the service
>> process, though.  With the current system, the only thing it needs
>> to know is the PID of the service processes that are to be culled by
>> calls to waitpid().  So you may have to extend existing bookkeeping
>> data structures a bit to keep those pieces of information around if
>> you wanted to add such a new hook.
>>
>>
For now I'm trying to do the following:
access-hook.bash has:
delayed-notify.bash $@ &
delayed-notify.bash has:

sleep 10 ... curl ...

I'm expecting access-hook to spawn new process and return without waiting for it to finish to let the service to do its job. But when i do push - it sleeps for 10 seconds anyway. Am i missing something obvious here?

Any help is much appreciated!

Thanks, Eugene

Previous: Eugene SajineNext: Eugene Sajine
Message 6 of 10 in “Fwd: git-daemon access-hook race condition”
  1. Eugene SajineSep 12, 2013
  2. Junio C HamanoSep 12, 2013
  3. Fwd: Fwd: git-daemon access-hook race conditionEugene Sajine, Sep 12, 2013
  4. Junio C HamanoSep 12, 2013
  5. Eugene SajineSep 12, 2013
  6. Eugene SajineSep 12, 2013
  7. Eugene SajineSep 13, 2013
  8. Junio C HamanoSep 12, 2013
  9. Eugene SajineSep 12, 2013
  10. Junio C HamanoSep 12, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.