Skip to content

[BUG] Agent panics in serverless environment due to unwrap in cgroups-rs #10079

@JiezengDev

Description

@JiezengDev

Search before asking

  • I had searched in the issues and found no similar
    feature requirement.

DeepFlow Component

Agent

What you expected to happen

The deepflow-agent should run without panicking in a serverless environment. The agent panics due to an unwrap() on a None value within the cgroups-rs dependency.

Log:

[2025-07-11 15:08:24.864020 +08:00] ERROR [src/main.rs:111] panicked at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/cgroups-rs-0.2.11/src/memory.rs:135:32:
called `Option::unwrap()` on a `None` value
[2025-07-11 15:08:24.864099 +08:00] ERROR [src/main.rs:112]    0: deepflow_agent::main::{{closure}}

How to reproduce

Run the deepflow-agent in a serverless environment where cgroup files are not available.

DeepFlow version

I will need you to provide the output of kubectl exec -it -n deepflow ds/deepflow-agent -- deepflow-agent -v

11800-5c4ccc85dcd6f96147a7805ca07b36d2409b2485
Name: deepflow-agent community edition
Branch: v6.6
CommitId: 5c4ccc8
RevCount: 11800
Compiler: rustc 1.77.1 (7cf61ebde 2024-03-27)
CompileTime: 2025-07-01 09:43:59

Anything else

The panic occurs in the cgroups-rs dependency, which suggests that the agent is trying to access a cgroup file that is not available in the serverless environment. The current Cargo.toml for the agent specifies cgroups-rs = "0.2.9", but the panic is in version 0.2.11.

Suggested fix:

  1. Update the cgroups-rs dependency to the latest version.
  2. Ensure that the code handles potential None values gracefully when reading from cgroup files to avoid panics in environments where these files may not be present.

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions