t2857: Replace kill -0 with ps -p and remove redundant 2>/dev/null#2873
t2857: Replace kill -0 with ps -p and remove redundant 2>/dev/null#2873alex-solovyev wants to merge 1 commit intomainfrom
Conversation
- Replace all kill -0 $pid 2>/dev/null with ps -p $pid >/dev/null to avoid masking EPERM errors on process existence checks (lines 122, 138, 891, 900) - Remove 2>/dev/null from cat after file existence check — the || echo fallback is sufficient and stderr should remain visible (line 1496) - Update comment referencing kill -0 to ps -p (line 906) ShellCheck: zero violations. Closes #2857
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the robustness and debuggability of shell scripts by refining how process existence is checked and how errors are handled. The changes prevent the suppression of critical error messages, particularly Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Thu Mar 5 02:54:37 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
|
There was a problem hiding this comment.
Code Review
This pull request correctly replaces the less-robust kill -0 ... 2>/dev/null pattern with ps -p ... >/dev/null for checking process existence. This change is a good improvement as it avoids masking potential permission errors while still correctly checking if a process is running. Additionally, the removal of redundant error suppression on a cat command within a file existence check is also a good practice, improving debuggability. The changes are well-reasoned and correctly implemented across the pulse-wrapper.sh script.



Summary
kill -0 $pid 2>/dev/nullwithps -p $pid >/dev/nullto avoid masking EPERM errors on process existence checks (4 instances)2>/dev/nullfromcatafter file existence check — the|| echofallback is sufficient and stderr should remain visible for debuggingkill -0tops -pDetails
Addresses 3 medium findings from Gemini review on PR #2853, plus 2 additional instances of the same
kill -0 2>/dev/nullanti-pattern found incheck_dedup().Why
ps -poverkill -0:kill -0with2>/dev/nullsuppresses all stderr, including EPERM errors that indicate the process exists but is owned by another user.ps -pwith only stdout suppressed (>/dev/null) lets real errors through while still returning the correct exit code for process existence.ShellCheck: zero violations.
Closes #2857