Skip to content

[client] Log duplicate client ui pid #3915

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 3, 2025
Merged

[client] Log duplicate client ui pid #3915

merged 1 commit into from
Jun 3, 2025

Conversation

lixmal
Copy link
Contributor

@lixmal lixmal commented Jun 3, 2025

Describe your changes

Issue ticket number and link

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

@Copilot Copilot AI review requested due to automatic review settings June 3, 2025 08:27
Copy link

sonarqubecloud bot commented Jun 3, 2025

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the duplicate-process check by returning the PID of any existing client UI process and logging it when detected.

  • IsAnotherProcessRunning now returns the PID of a duplicate process alongside the boolean and error.
  • Updated the main entrypoint to receive the PID and include it in the warning log.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
client/ui/process/process.go Changed IsAnotherProcessRunning signature to (int32, bool, error) and updated all return points to include PID.
client/ui/client_ui.go Updated call to IsAnotherProcessRunning to unpack the PID and log it with Warnf.
Comments suppressed due to low confidence (2)

client/ui/client_ui.go:98

  • [nitpick] Consider renaming the local variable pid to something like duplicatePID to clearly distinguish it from the current process's PID and improve readability.
log.Warnf("another process is running with pid %d, exiting", pid)

client/ui/process/process.go:36

  • Add or extend unit tests for IsAnotherProcessRunning to cover both the 'no duplicate' case (returning PID=0) and the case where a duplicate process is found, validating the returned PID.
return 0, false, nil

@lixmal lixmal merged commit f367925 into main Jun 3, 2025
35 of 36 checks passed
@lixmal lixmal deleted the dup-ui-pid branch June 3, 2025 08:52
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.

2 participants