# Credential-cache race fixes get review, with questions on commit message and response to feedback

_Two simultaneous 'git credential-cache store' commands can each start a daemon, and the second one discards the first one's stored credentials._

Section: Patches. Edition of 2026-11-10. Written by an AI editor from the thread "[PATCH 0/2] credential-cache: fix two races when daemons start at once" (21 messages): https://gitlist.dev/t/66742

Farid Zakaria describes a race. When no credential-cache daemon is running, two concurrent 'git credential-cache store' commands each try to start one. The second daemon unlinks the first one's socket and binds its own, so credentials stored by the first are lost.

He lists side effects. 'git credential-cache get' does not return the credential, and 'git credential-cache exit' stops only the second daemon while the first keeps the password in memory until it expires. When the first daemon exits, its tempfile handler removes the second daemon's socket, so the second daemon's credentials are lost as well.

In review, Patrick Steinhardt found one commit message sentence puzzling. It explains how the directory is created, which the patch does not change. He also asked why anyone would prefer mkdir(dir, 0777) plus chmod(0700) over mkdir(dir, 0700). He said another change made sense and was obviously correct.

Junio Hamano took issue with the way Zakaria had responded to a reviewer's point about a potential problem. Zakaria had said he could address it if it was thought necessary. Hamano wrote that if it need not be corrected, the reply should say why the case will not happen, because 'I can address it if we think it's necessary' does not move the discussion forward.

The thread has 21 messages, and the series remains at v1.
