Skip to content

t1400: Replace kill -0 with ps -p and remove redundant 2>/dev/null in pulse-wrapper.sh#2879

Merged
alex-solovyev merged 1 commit intomainfrom
bugfix/t1400-pulse-wrapper-stderr-suppression
Mar 5, 2026
Merged

t1400: Replace kill -0 with ps -p and remove redundant 2>/dev/null in pulse-wrapper.sh#2879
alex-solovyev merged 1 commit intomainfrom
bugfix/t1400-pulse-wrapper-stderr-suppression

Conversation

@alex-solovyev
Copy link
Collaborator

Summary

  • Replace all kill -0 $pid 2>/dev/null with ps -p $pid >/dev/null to avoid masking EPERM errors when checking process liveness (lines 122, 138, 891, 900)
  • Remove redundant 2>/dev/null from cat after -f existence check (line 1496) — the || echo "0" fallback handles failure; stderr suppression hides permission errors
  • Update inline comment referencing kill -0 to ps -p (line 906)

Why

kill -0 with 2>/dev/null suppresses all stderr, including EPERM errors that indicate the process exists but is owned by another user. ps -p with only stdout redirected preserves stderr visibility for debugging while still cleanly checking process existence. Similarly, cat after a -f check doesn't need stderr suppression — the file is known to exist, so any cat failure (e.g., permission denied) should be visible.

Verification

  • ShellCheck: zero violations
  • All 5 kill -0 instances replaced (4 code + 1 comment)
  • No remaining kill -0 in the file

Closes #2857

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 5, 2026

Warning

Rate limit exceeded

@alex-solovyev has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 17 minutes and 27 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 392805bf-e7ed-491c-aba7-bad7388e8ba7

📥 Commits

Reviewing files that changed from the base of the PR and between 9d30fe7 and c0df2c5.

📒 Files selected for processing (1)
  • .agents/scripts/pulse-wrapper.sh
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bugfix/t1400-pulse-wrapper-stderr-suppression

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link

Summary of Changes

Hello, 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 refines the robustness and debuggability of process management within the pulse-wrapper.sh script. By switching from kill -0 to ps -p for liveness checks and removing unnecessary error suppression from cat commands, the changes ensure that potential permission-related issues or other errors are no longer silently ignored, leading to clearer diagnostics and more reliable script execution.

Highlights

  • Process Liveness Checks: Replaced all instances of kill -0 $pid 2>/dev/null with ps -p $pid >/dev/null to prevent masking EPERM errors, ensuring better visibility for debugging when checking if a process is alive.
  • Error Redirection Removal: Removed redundant 2>/dev/null from cat commands after a file existence check, as the || echo "0" fallback already handles failures and suppressing stderr could hide permission errors.
  • Comment Update: Updated an inline comment referencing kill -0 to reflect the new ps -p command.
Changelog
  • .agents/scripts/pulse-wrapper.sh
    • Updated process liveness checks from kill -0 to ps -p in check_dedup and the watchdog loop.
    • Removed 2>/dev/null from a cat command within run_daily_quality_sweep.
    • Modified an inline comment to reflect the change from kill -0 to ps -p.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors process liveness checks by replacing kill -0 with ps -p to avoid masking permission errors. It also removes a redundant 2>/dev/null from a cat command that is already guarded by a file existence check, improving visibility for other potential file access errors. The changes are consistent and align with the goal of improving script robustness and debuggability. I have reviewed the implementation and have no further feedback.

@alex-solovyev
Copy link
Collaborator Author

This PR has merge conflicts after recent merges to main. Dispatching a worker to rebase and resolve conflicts.

…ulse-wrapper.sh

- Replace all 'kill -0 $pid 2>/dev/null' with 'ps -p $pid >/dev/null' to avoid
  masking EPERM errors (lines 122, 138, 891, 900)
- Remove redundant 2>/dev/null from cat after -f existence check (line 1496) —
  the || echo fallback is sufficient; stderr suppression hides permission errors
- Update inline comment referencing kill -0 to ps -p (line 906)

Closes #2857
@alex-solovyev alex-solovyev force-pushed the bugfix/t1400-pulse-wrapper-stderr-suppression branch from 6e31dc4 to c0df2c5 Compare March 5, 2026 03:47
@github-actions
Copy link

github-actions bot commented Mar 5, 2026

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 107 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Thu Mar 5 03:47:29 UTC 2026: Code review monitoring started
Thu Mar 5 03:47:30 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 107

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 107
  • VULNERABILITIES: 0

Generated on: Thu Mar 5 03:47:32 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 5, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

t1400: fix: pulse-wrapper.sh 2>/dev/null suppressions

1 participant