Problem/Motivation

I thought I'd try the using the new drush maestro:orchestrate command in cron, to save a HTTP round trip each time.

But I had to use drush maestro:orchestrate --quiet to suppress the "[notice] Starting Maestro orchestrator..." and "[success] Maestro orchestrator finished." output. I figured that wouldn't be a problem.

However, then one of the custom tasks failed (threw an exception), and I didn't get an email notification from cron as I expected, so I didn't find out about it until a user reported it days later.

I found this is because the exception is caught in MaestroCommands::orchestrate() and turned into a logged error:

try {
  // ...
}
catch (\Throwable $e) {
  $this->logger()->error('Exception while running orchestrator: ' . $e->getMessage());
  return 1;
}

This has two downsides:

1. The Drush --quiet flag suppresses error messages as well as success and notices :-( (but doesn't suppress exceptions).
2. There's no way to see the backtrace to track down the cause (normally -v will show it).

Steps to reproduce

  • Make a Maestro batch function task that throws an exception
  • Run drush maestro:orchestrate --quiet

Proposed resolution

Remove the try/catch completely - Drush will handle it correctly (display the error and set the exit code to 1).

Remaining tasks

User interface changes

API changes

Data model changes

Comments

mi-dave created an issue. See original summary.

  • _randy committed 23cf6658 on 4.x
    fix: #3559056 'drush maestro:orchestrate --quiet' doesn't display...
_randy’s picture

Status: Active » Postponed (maintainer needs more info)

Sure, I removed the try/catch and updated the parameter returns to use the Drush commands constants.

Let me know if that helps.

mi-dave’s picture

Status: Postponed (maintainer needs more info) » Reviewed & tested by the community

Yes, that works perfectly, thanks!

(You might want to use the constants in startProcess() too. :-))

  • _randy committed 8064f3c8 on 4.x
    fix: #3559056 'drush maestro:orchestrate --quiet' doesn't display...
_randy’s picture

Status: Reviewed & tested by the community » Fixed

Ah, indeed. Fixed as well. I'll close this issue down!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.