Unexpected output: Affected paths: relative - resubmit patch.
⚙ D440 INP-1569 - Create System Log record, when stale semaphore is discovered or hit
Page MenuHomeIn-Portal Phabricator

INP-1569 - Create System Log record, when stale semaphore is discovered or hit
ClosedPublic

Authored by alex on Feb 3 2023, 10:57 AM.

Details

Test Plan
NOTE: Test on both "clean install" and "upgraded website".

Test plan

  1. in the Admin Console
    1. if the Semaphores database table isn't empty, then clear it
    2. go to the ConfigurationWebsiteAdvanced section
    3. confirm, that the Delete Stuck Semaphores after system setting is present
    4. go to ConfigurationWebsiteStop Words section
    5. open any record for editing
    6. save it
    7. confirm, that the Semaphores table is still empty
  2. in IDE:
    1. open \kTempTablesHandler::SaveEdit method for editing
    2. comment-out the code, that deletes a semaphore (between $ids = $this->DoCopyTempToOriginal($this->Tables, null, $master_ids); and return $ids;
    3. save changes
  3. in the Admin Console
    1. go to ConfigurationWebsiteStop Words section
    2. open any record for editing
    3. save it
    4. confirm, that the Semaphores table has 1 record now related to the edited record
    5. go to the ConfigurationWebsiteScheduled Tasks section
    6. run the delete_stuck_semaphores scheduled task
    7. confirm, that above added semaphore record is still present in the Semaphores table
    8. go to ConfigurationWebsiteStop Words section
    9. open same record for editing and try to save it
    10. confirm, that:
      • after a delay of 30 seconds you'll see an alert explaining that saving has failed
      • the record was added to the Logs & ReportsSystem Logs section about a parallel editing attempt
    11. subtract 305 from the Timestamp column value of the above-added semaphore record (+save changes to db)
    12. run the delete_stuck_semaphores scheduled task
    13. confirm, that:
      • the above-added semaphore record is removed from the Semaphores table
      • the record was added to the Logs & ReportsSystem Logs section about a detected stuck semaphore

Diff Detail

Repository
rINP In-Portal
Branch
/in-portal/branches/5.2.x
Lint
Lint ErrorsExcuse: Haven't caused any of the issues.
SeverityLocationCodeMessage
Errorcore/kernel/utility/temp_handler.php:990PHPCS.E.CodingStandard.WhiteSpace.ControlStructureSpacing.SpaceBeforeCloseBraceCodingStandard.WhiteSpace.ControlStructureSpacing.SpaceBeforeCloseBrace
Errorcore/kernel/utility/temp_handler.php:990PHPCS.E.CodingStandard.WhiteSpace.ControlStructureSpacing.SpacingAfterOpenBraceCodingStandard.WhiteSpace.ControlStructureSpacing.SpacingAfterOpenBrace
Errorcore/kernel/utility/temp_handler.php:1053PHPCS.E.CodingStandard.Commenting.FunctionComment.MissingCodingStandard.Commenting.FunctionComment.Missing
Errorcore/kernel/utility/temp_handler.php:1053PHPCS.E.CodingStandard.NamingConventions.ValidFunctionName.NotCamelCapsCodingStandard.NamingConventions.ValidFunctionName.NotCamelCaps
Errorcore/kernel/utility/temp_handler.php:1053PHPCS.E.Squiz.Functions.FunctionDeclarationArgumentSpacing.SpaceAfterEqualsSquiz.Functions.FunctionDeclarationArgumentSpacing.SpaceAfterEquals
Errorcore/kernel/utility/temp_handler.php:1053PHPCS.E.Squiz.Functions.FunctionDeclarationArgumentSpacing.SpaceBeforeEqualsSquiz.Functions.FunctionDeclarationArgumentSpacing.SpaceBeforeEquals
Errorcore/kernel/utility/temp_handler.php:1053PHPCS.E.Squiz.Scope.MethodScope.MissingSquiz.Scope.MethodScope.Missing
Errorcore/units/admin/admin_events_handler.php:1275PHPCS.E.CodingStandard.NamingConventions.ValidFunctionName.ScopeNotCamelCapsCodingStandard.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
Errorcore/units/admin/admin_events_handler.php:1319PHPCS.E.CodingStandard.Classes.ClassDeclaration.NewlinesAfterCloseBraceCodingStandard.Classes.ClassDeclaration.NewlinesAfterCloseBrace
Unit
No Unit Test Coverage
Build Status
Buildable 1169
Build 1169: arc lint + arc unit

Event Timeline

alex created this revision.Feb 3 2023, 10:57 AM
alex requested review of this revision.Feb 3 2023, 10:57 AM
alex planned changes to this revision.Feb 3 2023, 11:00 AM
alex edited the test plan for this revision. (Show Details)
alex edited the test plan for this revision. (Show Details)Feb 6 2023, 6:44 AM
alex updated this revision to Diff 1131.Feb 6 2023, 6:46 AM

Changed terminology

alex updated this revision to Diff 1132.Feb 6 2023, 8:16 AM

Fixed outdated phrase translation.

erik accepted this revision.Feb 7 2023, 5:03 AM
This revision is now accepted and ready to land.Feb 7 2023, 5:03 AM
alex updated this revision to Diff 1152.May 3 2023, 6:30 AM

Ignore arguments in backtrace saved into the Semaphores table to radically reduce INSERT query size.

This revision was landed with ongoing or failed builds.Nov 21 2023, 3:15 AM
This revision was automatically updated to reflect the committed changes.