From de796a4d70bc5891a6dba5e1050ae265cfddfe36 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 26 Jun 2025 15:50:53 +0300 Subject: fix: improve dmap profiling error handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added || true to kill and wait commands in run_profile_dmap() to prevent script failures when processes exit with non-zero codes after receiving SIGINT. This is expected behavior when interrupting dmap. Note: There appears to be a separate issue where dtail commands (dcat, dgrep, dmap) hang when run in serverless mode with file arguments. This needs further investigation. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- benchmarks/profile_benchmarks.sh | 5 +++-- benchmarks/profile_dmap.sh | 12 ++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'benchmarks') diff --git a/benchmarks/profile_benchmarks.sh b/benchmarks/profile_benchmarks.sh index 976aaf7..1730091 100755 --- a/benchmarks/profile_benchmarks.sh +++ b/benchmarks/profile_benchmarks.sh @@ -89,8 +89,9 @@ run_profile_dmap() { sleep 3 # Send interrupt signal to make it exit cleanly - kill -INT $pid 2>/dev/null - wait $pid 2>/dev/null + # We expect this to return non-zero, so we ignore the exit code + kill -INT $pid 2>/dev/null || true + wait $pid 2>/dev/null || true echo " Completed" diff --git a/benchmarks/profile_dmap.sh b/benchmarks/profile_dmap.sh index 904c793..4983826 100755 --- a/benchmarks/profile_dmap.sh +++ b/benchmarks/profile_dmap.sh @@ -105,8 +105,8 @@ echo "Command: ../dmap -profile -profiledir $PROFILE_DIR -plain -cfg none -query ../dmap -profile -profiledir "$PROFILE_DIR" -plain -cfg none -query "$QUERY" -files "$TEST_DATA_DIR/stats_small.log" 2>&1 | head -10 & DMAP_PID=$! sleep 3 -kill -INT $DMAP_PID 2>/dev/null -wait $DMAP_PID 2>/dev/null +kill -INT $DMAP_PID 2>/dev/null || true +wait $DMAP_PID 2>/dev/null || true # Query 2: Aggregations echo -e "\n${YELLOW}Query: Sum and average${NC}" @@ -115,8 +115,8 @@ echo "Command: ../dmap -profile -profiledir $PROFILE_DIR -plain -cfg none -query ../dmap -profile -profiledir "$PROFILE_DIR" -plain -cfg none -query "$QUERY" -files "$TEST_DATA_DIR/stats_small.log" 2>&1 | head -10 & DMAP_PID=$! sleep 3 -kill -INT $DMAP_PID 2>/dev/null -wait $DMAP_PID 2>/dev/null +kill -INT $DMAP_PID 2>/dev/null || true +wait $DMAP_PID 2>/dev/null || true # Query 3: Min/Max echo -e "\n${YELLOW}Query: Min and max${NC}" @@ -125,8 +125,8 @@ echo "Command: ../dmap -profile -profiledir $PROFILE_DIR -plain -cfg none -query ../dmap -profile -profiledir "$PROFILE_DIR" -plain -cfg none -query "$QUERY" -files "$TEST_DATA_DIR/stats_small.log" 2>&1 | head -10 & DMAP_PID=$! sleep 3 -kill -INT $DMAP_PID 2>/dev/null -wait $DMAP_PID 2>/dev/null +kill -INT $DMAP_PID 2>/dev/null || true +wait $DMAP_PID 2>/dev/null || true echo echo -e "${GREEN}Analyzing dmap profiles...${NC}" -- cgit v1.2.3