HomePhabricator

Ensure the repository configuration lock is released

Description

Ensure the repository configuration lock is released

When zuul initializes a fresh clone of a git repository, it attempts to set
the user.name and user.email configuration options in .git/config. This job is
the responsibility of GitConfigParser, which is currently broken, because
GitConfigParser.write() acquires a lock but does not release it. The lock is
released in the object's del method, which is invoked when the object is
about to be dereferenced. This is not a reliable means of ensuring the
lock is released, because it can break if there is a circular reference keeping
the object alive, or if another GitConfigParser object for the same
repository is initiated while a reference to the existing one is still held.
The author of GitPython appears to still be struggling with this as of
commit a05e49d2419 of GitPython[0]. Fortunately, we don't have to chase this
down: we can just clear the lock when we know we're done, rather than hope that
del gets called.

[0]: https://github.com/gitpython-developers/GitPython/commit/a05e49d2419

Change-Id: Ie869f0b147577d3b2a0b57afba4474ee07753210

Details

Provenance
oriAuthored on Jan 14 2015, 4:42 AM
hasharCommitted on Aug 29 2016, 10:26 AM
Parents
rCIZUc55402620268: New release 2.5.0-8-gcbc7f62-wmf2precise1
Branches
Unknown
Tags
Unknown
ChangeId
Ie869f0b147577d3b2a0b57afba4474ee07753210