Skip to content

Commit

Permalink
memory-monitor: Add error tolerance to memory allocation logging in h…
Browse files Browse the repository at this point in the history
…andler script.

Allow the memory-monitor-handler script to proceed even if no memory
allocation sites are found in `logread` output. Previously, if `logread`
returned no matches for "logMemAllocationSites," the script would
terminate due to `set -e`. This change adds `|| :` to handle the
potential absence of matches, enabling the script to continue executing
subsequent commands.

Signed-off-by: Nikolay Martyanov <nikolay@zededa.com>
  • Loading branch information
OhmSpectator committed Nov 4, 2024
1 parent b487e9a commit fbb6ed0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/memory-monitor/src/monitor/memory-monitor-handler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ show_pid_mem_usage "eve" "$sorted_eve_processes" "$current_output_dir/memstat_ev
# ==== Dump memory allocation sites for Pillar ====

eve dump-memory
logread | grep logMemAllocationSites > "$current_output_dir/allocations_pillar.out"
logread | grep logMemAllocationSites > "$current_output_dir/allocations_pillar.out" || :

# ==== Trigger a heap dump for Pillar ====

Expand Down

0 comments on commit fbb6ed0

Please sign in to comment.