Skip to content

Commit

Permalink
systemd: Prevent insights-client crash when stdout is closed
Browse files Browse the repository at this point in the history
INsights-client produces a long backtrace in the journal when it tries
to log a warning or error to a closed stdout. This has started to
hapen recently and causes our tests to fail due to the unexpected
journal messages.
  • Loading branch information
mvollmer authored and martinpitt committed Feb 14, 2024
1 parent 844bab4 commit afb7667
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/systemd/overview-cards/insights-poll-hack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ details_out_of_date ()

tries=0
while [ $tries -lt 20 ] && details_out_of_date; do
insights-client --check-results
# We let insights-client write to /dev/null so that it doesn't
# crash should our stdout be closed.
insights-client --check-results >/dev/null
if [ $tries -lt 5 ]; then
sleep 10
else
Expand Down

0 comments on commit afb7667

Please sign in to comment.