Skip to content
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

fix(podman): fix blocked thread on container inspection request #1524

Merged

Conversation

andrewazores
Copy link
Member

Welcome to Cryostat! 👋

Before contributing, make sure you have:

  • Read the contributing guidelines
  • Linked a relevant issue which this PR resolves
  • Linked any other relevant issues, PR's, or documentation, if any
  • Resolved all conflicts, if any
  • Rebased your branch PR on top of the latest upstream main branch
  • Attached at least one of the following labels to the PR: [chore, ci, docs, feat, fix, test]
  • Signed the last commit: git commit --amend --signoff

Related to #1514

Description of the change:

Executes the Podman API request for listing containers on the Vert.x context, and the subtask request for inspecting individual containers (if needed: no jmxHost label or jmxUrl label) on a worker thread.

Motivation for the change:

This fixes a bug where the executor thread gets blocked when it needs to list containers and then further inspect them. This blockage results in failure of the platform client to discover containers.

How to manually test:

  1. Apply the patch below, then:
  2. Run CRYOSTAT_IMAGE=quay.io... sh run.sh...
diff --git a/run.sh b/run.sh
index 9d322386..e58ca4f7 100755
--- a/run.sh
+++ b/run.sh
@@ -123,9 +123,7 @@ podman run \
     --name cryostat \
     --user 0 \
     --label io.cryostat.discovery="true" \
-    --label io.cryostat.jmxHost="localhost" \
-    --label io.cryostat.jmxPort="0" \
-    --label io.cryostat.jmxUrl="service:jmx:rmi:///jndi/rmi://localhost:0/jmxrmi" \
+    --label io.cryostat.jmxPort="${CRYOSTAT_RJMX_PORT}" \
     --memory 768M \
     --mount type=bind,source="$(dirname "$0")/archive",destination=/opt/cryostat.d/recordings.d,relabel=shared \
     --mount type=bind,source="$(dirname "$0")/certs",destination=/certs,relabel=shared \
@@ -136,7 +134,7 @@ podman run \
     --mount type=bind,source="$(dirname "$0")/probes",destination=/opt/cryostat.d/conf.d/probes.d,relabel=shared \
     -v "$XDG_RUNTIME_DIR"/podman/podman.sock:/run/user/0/podman/podman.sock:Z \
     --security-opt label=disable \
-    -e CRYOSTAT_ENABLE_JDP_BROADCAST="true" \
+    -e CRYOSTAT_ENABLE_JDP_BROADCAST="false" \
     -e CRYOSTAT_REPORT_GENERATOR="$CRYOSTAT_REPORT_GENERATOR" \
     -e CRYOSTAT_PLATFORM="$CRYOSTAT_PLATFORM" \
     -e CRYOSTAT_DISABLE_BUILTIN_DISCOVERY="$CRYOSTAT_DISABLE_BUILTIN_DISCOVERY" \

@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2023

Test image available:

$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1524-628394a1ffeabd5726600c1b701aee25561744cd sh smoketest.sh

@andrewazores andrewazores requested a review from tthvo June 7, 2023 17:32
@andrewazores andrewazores deleted the podman-discovery-inspection branch June 7, 2023 17:43
@andrewazores andrewazores restored the podman-discovery-inspection branch June 7, 2023 17:47
@andrewazores andrewazores reopened this Jun 7, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2023

Test image available:

$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1524-628394a1ffeabd5726600c1b701aee25561744cd sh smoketest.sh

Copy link
Member

@tthvo tthvo left a comment

Choose a reason for hiding this comment

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

Looks good! Fixed the issue! Just a comment above :))

@andrewazores andrewazores force-pushed the podman-discovery-inspection branch from 628394a to 08d475a Compare June 7, 2023 23:04
@andrewazores andrewazores force-pushed the podman-discovery-inspection branch from 08d475a to 5cfd8ea Compare June 7, 2023 23:04
@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2023

Test image available:

$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1524-5cfd8ea6c7861211314e6310a0044c063892153f sh smoketest.sh

@andrewazores andrewazores merged commit ade6bf5 into cryostatio:main Jun 8, 2023
@andrewazores andrewazores deleted the podman-discovery-inspection branch June 8, 2023 03:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants