Skip to content

FOUR-21497 - Fix script retry error handling for script microservice #7926

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

Closed
wants to merge 4 commits into from

Conversation

nolanpro
Copy link
Contributor

Issue & Reproduction Steps

Script retries were not working with the new microservice

Solution

  • Modify the microservice-specific code to support retries

Changed Async to Sync

In the rest-script-runner-2025-winter branch, $sync param is false when running async script tasks. This results in 2 async processes

Run Script -> Async Job -> Run Microservice Script -> Run Async on Microservice

This would complicate the Retry error handling logic and I believe it's unnecessary and could result in additional complexity in the life cycle.

So in this PR I changed it to sync so the original retry logic works the same as it did previously.

How to Test

See jira issue

Related Tickets & Packages

Code Review Checklist

  • I have pulled this code locally and tested it on my instance, along with any associated packages.
  • This code adheres to ProcessMaker Coding Guidelines.
  • This code includes a unit test or an E2E test that tests its functionality, or is covered by an existing test.
  • This solution fixes the bug reported in the original ticket.
  • This solution does not alter the expected output of a component in a way that would break existing Processes.
  • This solution does not implement any breaking changes that would invalidate documentation or cause existing Processes to fail.
  • This solution has been tested with enterprise packages that rely on its functionality and does not introduce bugs in those packages.
  • This code does not duplicate functionality that already exists in the framework or in ProcessMaker.
  • This ticket conforms to the PRD associated with this part of ProcessMaker.

@nolanpro nolanpro requested a review from gusys January 22, 2025 18:40
@@ -108,7 +108,7 @@ public function action(ProcessRequestToken $token = null, ScriptTaskInterface $e
'attempts' => $this->attemptNum,
],
];
$response = $script->runScript($data, $configuration, $token->getId(), $errorHandling->timeout(), 0, $metadata);
$response = $script->runScript($data, $configuration, $token->getId(), $errorHandling->timeout(), 1, $metadata);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nolanpro here we are forcing this to be sync. This is not the idea, we should control this in the callback response.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@epdl in that case, should we remove ProcessMaker/Jobs/RunScriptTask.php and make this entirely synchronous from core's point of view? Do you see any point in using horizon/queues in core for scripts? Queueing one job that queues another job would make the process error prone

Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarQube

@nolanpro
Copy link
Contributor Author

Closing in favor of #7949

@nolanpro nolanpro closed this Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants