Fixed
Details
Priority
MinorAssignee
AlexAlexReporter
AlexAlexDeveloper
AlexAlexReviewer
Erik S.Erik S.Change Log Group
AddedChange Log Message
A record is created in System Log, when stale semaphores are discovered or hit by other users.Patch Instructions
Patches must be submitted through Phabricator.
To submit patch via Command Line use Patches Workflow (via Arcanist) tutorial.
To submit patch via Web Interface use Patches Workflow (via Web Interface) tutorial.
Time tracking
4h 53m loggedStory Points
2Fix versions
Details
Details
Priority
Assignee
Alex
AlexReporter
Alex
AlexDeveloper
Alex
AlexReviewer
Erik S.
Erik S.Change Log Group
Added
Change Log Message
A record is created in System Log, when stale semaphores are discovered or hit by other users.
Patch Instructions
Patches must be submitted through Phabricator.
To submit patch via Command Line use Patches Workflow (via Arcanist) tutorial.
To submit patch via Web Interface use Patches Workflow (via Web Interface) tutorial.
Time tracking
4h 53m logged
Story Points
2
Fix versions
Created June 27, 2016 at 9:22 AM
Updated December 29, 2024 at 8:47 PM
Resolved November 21, 2023 at 9:06 AM
when somebody hits a semaphore and sees error message log it into "System Log" with "Error" Log Level - 0.5h
add following columns to "Semaphores" table: - 0.5h
MainIDs - db type: text; comma-separated list of IDs
UserId - db type: int
IpAddress - db type: varchar(15)
Hostname - db type: varchar(255)
LogRequestURI - db type: varchar(255)
Backtrace - db type: longtext;
add following setting in the "System Settings" sub-section in the "Configuration > Website > Advanced" section: - 0.5h
name: "SemaphoreLifetime"
title: "Semaphore Inactivity Timeout (seconds)"
default: 300 (means 5 minutes)
create "adm:OnDeleteStaleSemaphores" event, that will: - 1.5h
get records from "Semaphores" table, where "Semaphores.Timestamp + {SemaphoreLifetime} > UNIX_TIMESTAMP()"
if none found, then exit
for each found record:
create record in "SystemLog" table (using "$this->Application->log" method) where:
the "setLogField" method will be used to replace "LogHostname", "LogRequestSource", "LogRequestURI", "LogUserId", "IpAddress" and "LogSessionKey" field values with one, that Semaphore has
the "addTrace" method will be used to add trace from semaphore
the "setUserData" method will be used to store: value of "MainIDs" field, semaphore creation time, semaphore removal time
"Log Level" would be "error"
"Message" would be "Stale semaphore discovered"
goal is to make that record look like it was created along with semaphore creation
delete semaphore record
turn "adm:OnDeleteStaleSemaphores" event into a scheduled task, that will run each 5 minutes - 0.5h
Quote: 3.5h*1.4=5h