Page MenuHomePhabricator

Avoid possible HarbormasterBuildCommand leaks during job restarts
AbandonedPublic

Authored by epriestley on Mar 16 2021, 11:48 AM.

Details

Reviewers
artms
Group Reviewers
Blessed Reviewers
Summary

HarbormasterBuildCommand might not yet be committed when HarbormasterBuildWorker is actually executed. When command is "leaked" - Harbormaster job gets into the start of "restarting" which can only be solved by submitting new changes into Revision.

Test Plan

Deploy change, try restarting harbormaster job and it should succeed

Diff Detail

Repository
rP Phabricator
Branch
master
Lint
Lint Passed
Unit
Tests Skipped
Build Status
Buildable 25276
Build 34888: Run Core Tests
Build 34887: arc lint + arc unit

Event Timeline

Owners added a subscriber: Restricted Owners Package.Mar 16 2021, 11:48 AM
src/applications/harbormaster/editor/HarbormasterBuildTransactionEditor.php
109

Leaking of commands and "no longer" restartable test job can be reproduced by adding sleep here.

sleep(30);

And after you restart job you'll see that HarbormasterBuildWorker is created in worker_activetask but build command is not created in harbomaster_buildcommand table. This causes HarbormasterBuildWorker to bail out quite soon (no command to execute) and once transaction is fully commited - build command is created which essentially locks build in 'restarting' phase which can only be fixed by adding new diff to revision

epriestley abandoned this revision.
epriestley edited reviewers, added: artms; removed: epriestley.

Please report this issue via Discourse, or, if applicable, your organization's support channel, rather than sending a patch.

This patch isn't the right way to approach this issue, and a clear bug report with clear reproduction steps would be far more useful.