Skip to content
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

Return error instead of killing process #24

Merged
merged 1 commit into from
Jul 16, 2024

Conversation

vvakar
Copy link
Contributor

@vvakar vvakar commented Jun 20, 2024

Rather than kill the whole load test (which is what log.Fatal does), proposing to delegate error handling so user can decide on:

  • retry policy
  • tracking error/retry metrics
  • finer-grained error handling policy

@vvakar vvakar requested a review from a team as a code owner June 20, 2024 15:03
@vvakar vvakar requested review from pablochacin and removed request for a team June 20, 2024 15:03
@CLAassistant
Copy link

CLAassistant commented Jun 20, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@pablochacin pablochacin left a comment

Choose a reason for hiding this comment

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

Hi @vvakar Thanks for your interest in contributing to the project.
The changes you propose are breaking changes making any existing test that uses this extension to change their behavior.

I think it would be better to add an option that controls this behavior and ensure the current behavior is the default. For example, add the option ContinueOnError and

if err != nil && !opts.ContinueOnError then {
  		log.Fatal(err.Error() + " on command: " + name + " " + strings.Join(args, " "))
 }
 return string(out), err

@pablochacin pablochacin self-assigned this Jul 4, 2024
@vvakar
Copy link
Contributor Author

vvakar commented Jul 4, 2024

Hi @pablochacin, point well taken! I'll make that change.

@vvakar vvakar force-pushed the returnError branch 2 times, most recently from 440888f to ce48e8d Compare July 4, 2024 10:43
exec.go Outdated Show resolved Hide resolved
examples/script.js Outdated Show resolved Hide resolved
Copy link
Contributor

@pablochacin pablochacin left a comment

Choose a reason for hiding this comment

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

LGTM

@vvakar
Copy link
Contributor Author

vvakar commented Jul 12, 2024

Thanks for approving @pablochacin! Pls note - I don't have write access to merge the PR.

@pablochacin pablochacin merged commit 3201b2f into grafana:main Jul 16, 2024
8 checks passed
@vvakar vvakar deleted the returnError branch July 31, 2024 08:20
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.

3 participants