Skip to content

Commit

Permalink
Fix sporadic error about broken pipe when checking recent SRs
Browse files Browse the repository at this point in the history
This code sometimes runs into:

```
Exception ignored in: <osc.util.safewriter.SafeWriter object at 0x7fbe42c17860>
BrokenPipeError: [Errno 32] Broken pipe
Retrying up to 3 more times after sleeping 3s …
```

This is easily reproducible by adding the condition into a separate script
and running it a few times. The additional `cat > /dev/null` which this
change introduces seems to fix the issue.

Related ticket: https://progress.opensuse.org/issues/167395
  • Loading branch information
Martchus committed Dec 5, 2024
1 parent fdc0461 commit 8d84a1c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion os-autoinst-obs-auto-submit
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,13 @@ if [[ -e job_post_skip_submission ]]; then
fi

# throttle number of submissions to allow only one SR within a certain number of days
if [[ $throttle_days != 0 ]] && $osc request list --project "$dst_project" --type submit --state new,review --mine --days "$throttle_days" | grep --quiet 'Created by'; then
if [[ $throttle_days != 0 ]] && $osc request list --project "$dst_project" --type submit --state new,review --mine --days "$throttle_days" \
| {
grep --quiet 'Created by'
rc=$?
cat > /dev/null
exit $rc
}; then
echo "Skipping submission, there is still a pending SR younger than $throttle_days days."
exit 0
fi
Expand Down

0 comments on commit 8d84a1c

Please sign in to comment.