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

implement more fine-grained exit codes for syncoid per #680 #722

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

amartin3225
Copy link

As discussed in #680, it is desirable for syncoid to distinguish between different types of errors using distinct exit codes. In particular, it is useful to use a separate exit code when the target filesystem is busy (when iszfsbusy is true). For example, in a syncoid setup sending datasets from A -> B -> C, B may be busy sending data to C when A tries to sync to B, so this allows us to distinguish that situation from other more severe errors.

To this end, this PR refactors the exit codes for syncoid as follows:

  • exit code 1 - transient errors that will likely resolve themselves, specifically Cannot sync now: $targetfs is already target of a zfs receive process
  • exit code 2 - "normal" errors (were previously set to $exitcode = 1)
  • exit code 3 - CRITICAL errors (were previously set to $exitcode = 2)

I realize that this results in a change in exit codes from prior behavior, however the code seems to indicate that exit codes should increase with severity, so it was necessary to shift everything by 1 since the transient errors are the least severe.

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.

1 participant