How to set the Pull Time Limit for Mercurial repos?
Event Timeline
Looking at the diff, I think this timeout only applies to Drydock cloning the repository for its builds, not for "observing" repositories - and Drydock might not support Mercurial anyway.
The timeout for the original import is 4 hours, which should be long enough for pretty much anything.
Are you seeing any error/exception log? Is there anything failing?
In the repo management panel, I see this error:
Raw Error Error updating working copy: Command failed with error #255! COMMAND hg --config ui.ssh=/var/www/phorge/phorge/bin/ssh-connect pull -- '********' STDOUT pulling from https://<redacted> STDERR waiting for lock on working directory of /var/repo/8 held by process '112297' on host 'ec6149cd0a0b/f000037a' abort: working directory of /var/repo/8: timed out waiting for lock held by 'ec6149cd0a0b/f000037a:112297'
Unfortunately, I don't really see a backtrace there. When I run bin/repository pull R8 from the command line, I see this error:
[2023-04-26 06:14:15] EXCEPTION: (Exception) Command failed with error #255! COMMAND hg --config ui.ssh=/var/www/phorge/phorge/bin/ssh-connect pull -- '********' STDOUT pulling from https://<redacted> STDERR waiting for lock on working directory of /var/repo/8 held by process '112297' on host 'ec6149cd0a0b/f000037a' abort: working directory of /var/repo/8: timed out waiting for lock held by 'ec6149cd0a0b/f000037a:112297' at [<phorge>/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php:740] arcanist(head=ca5f5cd1522c712f4bdb890ad49e993a9b51417c, ref.master=ca5f5cd1522c), phorge(head=1ba5c8c260950ce8bc77f261b41aa82ad5d776e2, ref.master=90f9da643d16) #0 PhabricatorRepositoryPullEngine::executeMercurialUpdate() called at [<phorge>/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php:134] #1 PhabricatorRepositoryPullEngine::pullRepositoryWithLock() called at [<phorge>/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php:40] #2 PhabricatorRepositoryPullEngine::pullRepository() called at [<phorge>/src/applications/repository/management/PhabricatorRepositoryManagementPullWorkflow.php:50] #3 PhabricatorRepositoryManagementPullWorkflow::execute(PhutilArgumentParser) called at [<arcanist>/src/parser/argument/PhutilArgumentParser.php:492] #4 PhutilArgumentParser::parseWorkflowsFull(array) called at [<arcanist>/src/parser/argument/PhutilArgumentParser.php:377] #5 PhutilArgumentParser::parseWorkflows(array) called at [<phorge>/scripts/repository/manage_repositories.php:22]
I did try to read through the code involved in that backtrace, and in PhabricatorRepositoryPullEngine::executeMercurialUpdate(), a future is created as I described above: Inside the repository's base class, which uses getEffectiveCopyTimeLimit() to determine the timeout.
I'm not sure where the buildUpdateFuture() function you linked to is used, but in the stack trace that I see (see previous comment), the future is buit inside executeMercurialUpdate(…), which calls $repository->getRemoteCommandFuture(), which boils down to the call newRemoteCommandEngine(…)->newFuture(); in the repo base class.
The newRemoteCommandEngine() calls returns a DiffusionCommandEngine, which uses getEffectiveCopyTimeLimit() in the newFuture() method.
I think the future() I linked for literally calls ./bin/repository update ..., and sets the timeout on that.
That invokes the future() you found, which calls hg pull, and adds another timeout.
I'm going to guess the dual-timeout is a bug (https://secure.phabricator.com/D19235 adds the 15 minutes one; D19831 makes it configurable), as in, it wasn't supposed to apply to this particular case.
I'll answer your original question as an "answer", but the tldr is "go ahead" and "manually update database".
Want to file the ticket?
From the exception
STDERR waiting for lock on working directory of /var/repo/8 held by process '112297' on host 'ec6149cd0a0b/f000037a'
It sounds like another hg process is operating on that repo at the time.
Assuming this as Resolved but feel free to attach other details in the question itself and reopen :)