Page MenuHomePhabricator

D10998.diff
No OneTemporary

D10998.diff

diff --git a/src/infrastructure/daemon/workers/query/PhabricatorWorkerLeaseQuery.php b/src/infrastructure/daemon/workers/query/PhabricatorWorkerLeaseQuery.php
--- a/src/infrastructure/daemon/workers/query/PhabricatorWorkerLeaseQuery.php
+++ b/src/infrastructure/daemon/workers/query/PhabricatorWorkerLeaseQuery.php
@@ -240,10 +240,23 @@
private function getLeaseOwnershipName() {
static $sequence = 0;
+ // TODO: If the host name is very long, this can overflow the 64-character
+ // column, so we pick just the first part of the host name. It might be
+ // useful to just use a random hash as the identifier instead and put the
+ // pid / time / host (which are somewhat useful diagnostically) elsewhere.
+ // Likely, we could store a daemon ID instead and use that to identify
+ // when and where code executed. See T6742.
+
+ $host = php_uname('n');
+ $host = id(new PhutilUTF8StringTruncator())
+ ->setMaximumBytes(32)
+ ->setTerminator('...')
+ ->truncateString($host);
+
$parts = array(
getmypid(),
time(),
- php_uname('n'),
+ $host,
++$sequence,
);

File Metadata

Mime Type
text/plain
Expires
May 11 2024, 7:44 PM (5 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6286701
Default Alt Text
D10998.diff (1 KB)

Event Timeline