Skip to content

KAFKA-21136: fix pid lookup for native process - #23537

Open
gaurav-narula wants to merge 2 commits into
apache:trunkfrom
gaurav-narula:KAFKA-21136
Open

gaurav-narula wants to merge 2 commits into
apache:trunkfrom
gaurav-narula:KAFKA-21136

Conversation

@gaurav-narula

@gaurav-narula gaurav-narula commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Modifies the pid lookup for native image process to use pgrep instead of relying on java_pids which uses jcmd and assumes a JVM.

Reviewers: Murali Basani muralidhar.basani@aiven.io

Modifies the pid lookup for native image process to use pgrep instead
of relying on `java_pids` which uses `jcmd` and assumes a JVM.
@github-actions github-actions Bot added triage PRs from the community tests Test fixes (including flaky tests) small Small PRs labels Sep 21, 2026
try:
kafka_mode = self.context.globals.get("kafka_mode", "")
if kafka_mode == "native":
return [int(pid) for pid in node.account.ssh_capture(f"pgrep {self.java_class_name()}", allow_fail=True)]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we have any processes running in native mode to test/verify this, now that pgrep is being used to find the pid ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for your review Murali!

The native process' name is kafka.Kafka and that's what self.java_class_name() returns. You can verify the correctness of this change by running a system test in native mode like so:

_DUCKTAPE_OPTIONS="--globals '{\"kafka_mode\":\"native\"}'" TC_PATHS="tests/kafkatest/tests/client/compression_test.py" bash tests/docker/run_tests.sh

@github-actions github-actions Bot removed the triage PRs from the community label Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-approved small Small PRs tests Test fixes (including flaky tests)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants