Skip to content

mc mirror --watch should exit with non-zero status code on failure #5162

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

Open
jadolg opened this issue Mar 10, 2025 · 1 comment
Open

mc mirror --watch should exit with non-zero status code on failure #5162

jadolg opened this issue Mar 10, 2025 · 1 comment

Comments

@jadolg
Copy link

jadolg commented Mar 10, 2025

Expected behavior

When any error occurs during the mirror operation, mc should exit with a non-zero status code instead of just logging the error and continuing.

Actual behavior

mc logs the errors but continues to run.

Steps to reproduce the behavior

Try anything that would cause a problem like non existing bucket in the destination.

mc --version

mc version RELEASE.2025-02-15T10-36-16Z (commit-id=383560b1c3d6912042e8c8c275bb78e83e67ef2b)
Runtime: go1.23.6 linux/amd64

System information

Ubuntu 22.04
5.15.0-122-generic

@jadolg jadolg changed the title mc mirror --watch should exit with non-zero code upon failure mc mirror --watch should exit with non-zero code on failure Mar 10, 2025
@jadolg jadolg changed the title mc mirror --watch should exit with non-zero code on failure mc mirror --watch should exit with non-zero status code on failure Mar 10, 2025
@jadolg
Copy link
Author

jadolg commented Mar 10, 2025

I think changing monitorMirrorStatus to use fatalIf instead of errorIf should solve this. This probably breaks the --retry flag though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant