Skip to content

Conversation

dmjb
Copy link
Member

@dmjb dmjb commented Sep 9, 2025

This follows on from the previous PRs which migrated PIDs from the PID files to status files.

Copy link

codecov bot commented Sep 9, 2025

Codecov Report

❌ Patch coverage is 30.39216% with 71 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.36%. Comparing base (70fc85c) to head (0715fb7).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/workloads/manager.go 16.21% 27 Missing and 4 partials ⚠️
pkg/workloads/statuses/file_status.go 48.07% 24 Missing and 3 partials ⚠️
...kg/workloads/statuses/mocks/mock_status_manager.go 0.00% 9 Missing ⚠️
pkg/workloads/statuses/status.go 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1805      +/-   ##
==========================================
- Coverage   47.37%   47.36%   -0.01%     
==========================================
  Files         233      232       -1     
  Lines       28649    28644       -5     
==========================================
- Hits        13572    13568       -4     
+ Misses      14062    14059       -3     
- Partials     1015     1017       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coveralls
Copy link
Collaborator

coveralls commented Sep 9, 2025

Coverage Status

coverage: 43.601% (+0.05%) from 43.554%
when pulling 64b9442 on use-status-file-for-pids
into d15faf0 on main.

@dmjb dmjb force-pushed the use-status-file-for-pids branch from 831204f to 366e4bf Compare September 10, 2025 12:01
@dmjb dmjb force-pushed the use-status-file-for-pids branch 4 times, most recently from 191d6de to 919cddb Compare September 11, 2025 17:27
@dmjb dmjb marked this pull request as ready for review September 11, 2025 19:25
@dmjb dmjb force-pushed the use-status-file-for-pids branch 6 times, most recently from a3f08a4 to 094ecd7 Compare September 16, 2025 09:55
Copy link
Member

@eleftherias eleftherias left a comment

Choose a reason for hiding this comment

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

question: It looks like the status for remote workloads is still reading from the PID file instead of the status file, is that intentional?

func (d *defaultManager) getRemoteWorkloadState(ctx context.Context, name, baseName string) *workloadState {
workloadSt := &workloadState{
BaseName: baseName,
}
// Check the workload status
workload, err := d.statuses.GetWorkload(ctx, name)
if err != nil {
// If we can't get the status, assume it's not running
logger.Debugf("Failed to get status for remote workload %s: %v", name, err)
workloadSt.Running = false
} else {
workloadSt.Running = workload.Status == rt.WorkloadStatusRunning
}
// Check if the detached process is actually running
workloadSt.ProxyRunning = proxy.IsRunning(baseName)
return workloadSt
}

func IsRunning(containerBaseName string) bool {
logger.Debugf("Checking if proxy process is running for container %s", containerBaseName)
if containerBaseName == "" {
logger.Warnf("Warning: Could not find base container name in labels")
return false
}
// Try to read the PID file
logger.Debugf("Reading PID file for container %s", containerBaseName)
pid, err := process.ReadPIDFile(containerBaseName)
if err != nil {
logger.Debugf("No PID file found for container %s", containerBaseName)
return false
}
// Check if the process exists and is running
logger.Debugf("Checking if process with PID %d is running", pid)
isRunning, err := process.FindProcess(pid)
if err != nil {
logger.Warnf("Warning: Error checking process: %v", err)
return false
}
return isRunning
}

@dmjb dmjb force-pushed the use-status-file-for-pids branch from 64b9442 to e18ae92 Compare September 16, 2025 15:25
JAORMX
JAORMX previously approved these changes Sep 19, 2025
This follows on from the previous PRs which migrated PIDs from the PID
files to status files.
@dmjb dmjb merged commit 21408ee into main Sep 19, 2025
19 of 20 checks passed
@dmjb dmjb deleted the use-status-file-for-pids branch September 19, 2025 15:17
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.

5 participants