Skip to content

Running only one sampling process #5166

@nugaon

Description

@nugaon

Summary

Implement synchronization mechanism to ensure only one sampling process runs at a time in agent.go, and prevent concurrent calls to rchash endpoint which can cause race conditions and inconsistent state.

Motivation

Currently, multiple sampling processes can be triggered concurrently, leading to:

  1. Race conditions in the agent.go module
  2. Inconsistent state when multiple processes try to access and modify the same resources
  3. Performance degradation and increased error rates when rchash endpoint is called simultaneously
  4. Potential deadlocks or system instability under high load

Implementation

Potential implementation approaches:
Add a mutex lock around the sampling process in agent.go

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions