-
Type: Feature Request
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 5.2.2-B3
-
Component/s: Database
-
Labels:None
-
Change Log Group:Added
-
Change Log Message:A record is created in System Log, when stale semaphores are discovered or hit by other users.
-
Story Points:2
-
Copy Issue Key:
-
Patch Instructions:
- 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
- create record in "SystemLog" table (using "$this->Application->log" method) where:
- turn "adm:OnDeleteStaleSemaphores" event into a scheduled task, that will run each 5 minutes - 0.5h
- get records from "Semaphores" table, where "Semaphores.Timestamp +
{SemaphoreLifetime}
Quote: 3.5h*1.4=5h
- implemented in
-
[Diffusion] rINP16770 Fixes INP-1569 - Create System Log record, when stale semaphore is discovered…
-
D440 INP-1569 - Create System Log record, when stale semaphore is discovered or hit
- mentioned in
-
Page Loading...