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

Re: What's cooking in git.git (Jul 2017, #04; Thu, 13)

From
Santiago Torres <santiago@nyu.edu>
Date
Jul 17, 2017, 21:42 UTC
Message-ID
<20170717214241.yui75hywg2ddkfsb@LykOS.localdomain>
In-Reply-To
<xmqqwp7bqbvg.fsf@gitster.mtv.corp.google.com>
> > I'll dig into this. This sounds a way more reasonable approach.
> 
> Thanks.  Another thing that may help, if it turns out that we do
> want to let agent run when it wants to

I did some digging on the reason as to why this was happening. It turns out there is a bug on gnupg. As of gpg 2.1.21, all operations require an agent running (BTW --no-use-agent is effectively a no-op now).

Given that on versions 2.19-21, they changed the way sockets are created to be stored on /run/user/UID/gnupg/... deleting the $GNUPG_HOME directory wouldn't flush the agent socket, and would leave an agent instance per test running, possibly forever. E.g., make test would result in the following:

    santiago at ~ ✔ pgrep -a gpg-agent
    632 gpg-agent --homedir /git/t/trash directory.t6050-replace/gpghome --use-standard-socket --daemon
    1192 /usr/bin/gpg-agent --supervised
    2939 gpg-agent --homedir /git/t/trash directory.t5801-remote-helpers/gpghome --use-standard-socket --daemon
    4656 gpg-agent --homedir /git/t/trash directory.t6300-for-each-ref/gpghome --use-standard-socket --daemon
    5427 gpg-agent --homedir /git/t/trash directory.t7510-signed-commit/gpghome --use-standard-socket --daemon
    5898 gpg-agent --homedir /git/t/trash directory.t6302-for-each-ref-filter/gpghome --use-standard-socket --daemon
    7747 gpg-agent --homedir /git/t/trash directory.t7003-filter-branch/gpghome --use-standard-socket --daemon
    12922 gpg-agent --homedir /git/t/trash directory.t7600-merge/gpghome --use-standard-socket --daemon
    13572 gpg-agent --homedir /git/t/trash directory.t7004-tag/gpghome --use-standard-socket --daemon
    14521 gpg-agent --homedir /git/t/trash directory.t5534-push-signed/gpghome --use-standard-socket --daemon
    16563 gpg-agent --homedir /git/t/trash directory.t5541-http-push-smart/gpghome --use-standard-socket --daemon
    17853 gpg-agent --homedir /git/t/trash directory.t7030-verify-tag/gpghome --use-standard-socket --daemon
    29858 gpg-agent --homedir /git/t/trash directory.t7612-merge-verify-signatures/gpghome --use-standard-socket --daemon
    31100 gpg-agent --homedir /git/t/trash directory.t4202-log/gpghome --use-standard-socket --daemon

Other projects such as notmuch opted for a solution that's simlar to what I had suggested[1], but I wonder if it's even necessary to do. There is already a fix on the master branch of gnupg[2], which I imagine will show up to the next version of gpg2.

I don't think it would make sense to fix anything on our side, unless we want to be extra sure the test suite is not leaking agents for all gpg versions (including these minor versions).

What is your take?

Thanks! -Santiago.

[1] https://paste.debian.net/976970/ [2] https://dev.gnupg.org/T3218

Previous: Junio C HamanoNext: Junio C Hamano
Message 6 of 13 in “What's cooking in git.git (Jul 2017, #04; Thu, 13)”
  1. Junio C HamanoJul 13, 2017
  2. Santiago TorresJul 14, 2017
  3. Junio C HamanoJul 14, 2017
  4. Santiago TorresJul 14, 2017
  5. Junio C HamanoJul 14, 2017
  6. Santiago TorresJul 17, 2017
  7. Junio C HamanoJul 17, 2017
  8. Santiago TorresJul 18, 2017
  9. Junio C HamanoJul 18, 2017
  10. Santiago TorresJul 18, 2017
  11. Junio C HamanoJul 18, 2017
  12. Ævar Arnfjörð BjarmasonJul 15, 2017
  13. Junio C HamanoJul 17, 2017

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.