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

Closed
opened 5 months ago by m3nu · 4 comments
m3nu commented 5 months 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
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 5 months 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. 👍
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 5 months 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

No due date set.

Dependencies

No dependencies set.

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