Exit code should be 0 if command succeeds after retry #517

Closed
opened 1 year ago by m3nu · 4 comments
m3nu commented 1 year ago

What I'm trying to do and why

The new retries and retry_wait settings are great to work around unstable connections.

Only issues is that Borgmatic still exits with code 1, as opposed to 0, even if the final retry succeeds.

Steps to reproduce (if a bug)

  1. Add retries and retry_wait settings
  2. Run some command that fails and later succeeds (by e.g. disconnecting from the internet for a few seconds)
  3. Borgmatic returns with exit code 1 even if the command succeeded after a retry.

Expected behavior (if a bug)

The exit code should be 0 if any retry succeeds.

Other notes / implementation ideas

Environment

borgmatic version: 1.5.23

borgmatic installation method: PyPi

Borg version: 1.2.0

Python version: Python 3.9.2

operating system and version: Debian 11

#### What I'm trying to do and why The new `retries` and `retry_wait` settings are great to work around unstable connections. Only issues is that Borgmatic still exits with code `1`, as opposed to `0`, even if the final retry succeeds. #### Steps to reproduce (if a bug) 1. Add `retries` and `retry_wait` settings 2. Run some command that fails and later succeeds (by e.g. disconnecting from the internet for a few seconds) 3. Borgmatic returns with exit code `1` even if the command succeeded after a retry. #### Expected behavior (if a bug) The exit code should be `0` if any retry succeeds. #### Other notes / implementation ideas #### Environment **borgmatic version:** 1.5.23 **borgmatic installation method:** PyPi **Borg version:** 1.2.0 **Python version:** Python 3.9.2 **operating system and version:** Debian 11
witten commented 1 year ago
Owner

Confirmed this issue with a local repro! Thanks so much for reporting it.

Confirmed this issue with a local repro! Thanks so much for reporting it.
witten added the
bug
label 1 year ago
m3nu commented 1 year ago
Poster

Thanks for this feature. It's something I was missing. Already added it to the template on our setup page and will also add it to the Ansible role. 👍

Thanks for this feature. It's something I was missing. Already added it to the template on our setup page and will also add it to the Ansible role. 👍
witten commented 1 year ago
Owner

The original retry feature was actually a PR (#432).

Anyway, I just pushed a fix for this to master, which will be part of the next release. Thanks again for pointing out this issue!

The original retry feature was actually a PR (#432). Anyway, I just pushed a fix for this to master, which will be part of the next release. Thanks again for pointing out this issue!
witten closed this issue 1 year ago
witten commented 1 year ago
Owner

Released in borgmatic 1.6.0!

Released in borgmatic 1.6.0!
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#517
Loading…
There is no content yet.