Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15331904
D10998.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D10998.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 8, 3:09 PM (5 d, 17 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7382909
Default Alt Text
D10998.diff (1 KB)
Attached To
Mode
D10998: Prevent worker queue leases from exceeding 64 characters
Attached
Detach File
Event Timeline
Log In to Comment