-
-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drall stuck when running a Drush command on a remote site inside a Docker container #77
Comments
Hey! This seems to be the same as #58. I will try and take a look at this asap. Thanks. In the meantime, can you try that command with a |
No difference, unfortunately. I've also tried rearranging the Drall flags, I saw that putting them after the command isn't officially supported. drall-hangs-2.mp4 |
I see the workers have been written with |
Using that library didn't change things. However, I found an interesting example to pipe output: https://github.com/amphp/parallel/blob/1.x/examples/process.php Replacing drall-hangs-with-output.mp4Then entire process still hangs, unfortunately. |
I suspected that the issue was within Drush, as I've encountered a similar issue with remote commands not finishing in another situation. We're encountering the same problem as this person: https://stackoverflow.com/questions/60694192/unittesting-a-symfony-4-2-process-runs-infinite-loop-than-times-out-wihout-un Namely, in $this->requireProcessIsStarted(__FUNCTION__);
$this->updateStatus(false);
if (null !== $callback) {
if (!$this->processPipes->haveReadSupport()) {
$this->stop(0);
throw new LogicException('Pass the callback to the "Process::start" method or call enableOutput to use a callback with "Process::wait".');
}
$this->callback = $this->buildCallback($callback);
}
do {
$this->checkTimeout();
$running = '\\' === \DIRECTORY_SEPARATOR ? $this->isRunning() : $this->processPipes->areOpen();
$this->readPipes($running, '\\' !== \DIRECTORY_SEPARATOR || !$running);
} while ($running);
while ($this->isRunning()) {
$this->checkTimeout();
usleep(1000);
}
if ($this->processInformation['signaled'] && $this->processInformation['termsig'] !== $this->latestSignal) {
throw new ProcessSignaledException($this);
}
return $this->exitcode; The part that is tripping us up is this: do {
$this->checkTimeout();
$running = '\\' === \DIRECTORY_SEPARATOR ? $this->isRunning() : $this->processPipes->areOpen();
$this->readPipes($running, '\\' !== \DIRECTORY_SEPARATOR || !$running);
} while ($running);
} Printing a spam.mp4After the remote command has completed, The solution is simple: use So, replacing $running = '\\' === \DIRECTORY_SEPARATOR ? $this->isRunning() : $this->processPipes->areOpen(); with $running = $this->isRunning(); Gets us this: drall-works.mp4 |
Seems like that line was introduced here: symfony/process@2ab8127?diff=split I'm not entirely sure why this was refactored this way. Before, I'll see if I can open an issue on their repository. EDIT: There was already one present, I've mentioned my research. |
Thanks a tonne for the research. I'll look into this as soon as I get time. I'll have to find a project on which I can use remote aliases first. |
@jigarius It might be possible to get this fixed in Drush instead of Symfony. The maintainer seems to be fine with it if we can prove it doesn't break anything. |
Sounds good to me. BTW, I just pushed the first As for this issue, I'll do some research this week. For now, maybe you can SSH into the remote container and then run Drall locally. |
On my side, even by getting in the container sometime it will get stuck. The only way we found to skip that is to skip interactive questions with --no-interactive. We use Lando for our local environment, and we don't have to SSH into our containers as long as we're patient and we use the --no-interactive flag. (patient not because of speed but because feedbacks is shown only once after each site is done). |
@lems3 I see. Since Drall uses a 3rd-party library for running commands in parallel, it is subject to the limitations of that library. The output buffering was added to prevent the output of multiple Drush commands (running in parallel) from mixing with each other. There is an issue for disabling the output buffer; see #57. As for the |
@beerendlauwers do you still face the problem described in this issue? If yes, can you please try the command with the latest changes in 4.x?
Thank you. Regards. |
I'm using Drall v2.1.0.
Running the command
vendor/bin/drall exec drush @@site.T cr
inside a container derived fromphp:8.1.18-cli
spawns workers, but they don't return the result or exit code:drall-hangs.mp4
My version has the code committed for #71, so I'm not sure what the issue could be.
The text was updated successfully, but these errors were encountered: