Skip to content

AP-25563 cannot obtain communication channel - backport to 5.5#94

Open
chaubold wants to merge 2 commits intoreleases/2025-07from
bug/AP-25563-cannot-obtain-communication-5.5
Open

AP-25563 cannot obtain communication channel - backport to 5.5#94
chaubold wants to merge 2 commits intoreleases/2025-07from
bug/AP-25563-cannot-obtain-communication-5.5

Conversation

@chaubold
Copy link
Copy Markdown
Contributor

  • synchronize access to m_gateway

…unication failures

Logs gateway lifecycle events (creation, closure) with thread and identity information
to help diagnose the root cause of "Cannot obtain a new communication channel" errors.
Tracks gateway ownership through object hash codes for correlation.

- DefaultPythonGateway.close(): Log PID and calling thread at INFO level
- PythonScriptingSession: Log gateway hash and thread at creation (INFO) and shutdown (ERROR)
- PythonGatewayTracker.clear(): Log process count and triggering thread at ERROR level
- QueuedPythonGatewayFactory: Log eviction count and thread at gate-close (WARN)
- PythonGatewayCreationGate: Include thread name in P2 phase event logs (INFO)
- PythonScriptNodeModel: Handle no-cause "Cannot obtain" variant with improved error message

When this error occurs again, correlating gateway hash and PID across log entries will
reveal which code path triggered the unexpected shutdown.

AP-25563 (Investigate "Cannot obtain a new communication channel" Python failures)
@chaubold chaubold requested a review from a team as a code owner March 30, 2026 06:41
@chaubold chaubold changed the base branch from master to releases/2025-07 March 30, 2026 06:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Backport for AP-25563 to the 5.5 line, addressing intermittent Py4J “cannot obtain communication channel” issues and related lifecycle/diagnostic improvements across the KNIME Python integration (Java ↔ Python bridge).

Changes:

  • Adjust Python gateway queue behavior when the PythonGatewayCreationGate closes, and add additional diagnostics around gateway/session lifecycle.
  • Improve proxy environment handling (credential escaping + Java | → Python no_proxy translation) and update Python API string representations + tests.
  • Add view/tool cleanup hooks (closeable data service proxies, temporary filestore handler switching) and bump bundle/feature versions + SonarCloud project key updates.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pom.xml Bumps repository revision; also the best anchor for confirming scope vs PR description.
org.knime.update.python/pom.xml Updates revision for the update site bundle.
org.knime.python3/src/main/python/knime/api/schema.py Changes primitive type display strings used in __str__ output.
org.knime.python3/src/main/python/knime/api/env.py Proxy parsing/serialization changes, no_proxy translation, and env var handling.
org.knime.python3/src/main/java/org/knime/python3/QueuedPythonGatewayFactory.java Modifies gateway-queue eviction behavior when the creation gate closes.
org.knime.python3/src/main/java/org/knime/python3/PythonGatewayTracker.java Adds more detailed diagnostics when aborting running Python processes.
org.knime.python3/src/main/java/org/knime/python3/PythonGatewayCreationGate.java Adds thread name info to gate open/close log statements.
org.knime.python3/src/main/java/org/knime/python3/DefaultPythonGateway.java Adds logging when closing a gateway (PID + thread).
org.knime.python3/META-INF/MANIFEST.MF Bundle version bump.
org.knime.python3/.settings/org.sonarlint.eclipse.core.prefs Updates SonarCloud projectKey casing.
org.knime.python3.views/src/main/java/org/knime/python3/views/HtmlFileNodeView.java Adds node-view lifecycle interface to trigger data service disposal on state changes.
org.knime.python3.views/pom.xml Revision bump for views module.
org.knime.python3.views/META-INF/MANIFEST.MF Bundle version bump for views.
org.knime.python3.views/.settings/org.sonarlint.eclipse.core.prefs Updates SonarCloud projectKey casing.
org.knime.python3.tests/src/test/python/unittest/test_knime_schema.py Updates expected string representations for schema/type printing.
org.knime.python3.tests/pom.xml Revision bump for tests bundle.
org.knime.python3.tests/META-INF/MANIFEST.MF Bundle version bump for tests.
org.knime.python3.tests/.settings/org.sonarlint.eclipse.core.prefs Updates SonarCloud projectKey casing.
org.knime.python3.testing/.settings/org.sonarlint.eclipse.core.prefs Updates SonarCloud projectKey casing.
org.knime.python3.scripting/.settings/org.sonarlint.eclipse.core.prefs Updates SonarCloud projectKey casing.
org.knime.python3.scripting.tests/pom.xml Revision bump for scripting tests bundle.
org.knime.python3.scripting.tests/META-INF/MANIFEST.MF Bundle version bump for scripting tests.
org.knime.python3.scripting.tests/.settings/org.sonarlint.eclipse.core.prefs Updates SonarCloud projectKey casing.
org.knime.python3.scripting.py4j.dependencies/.settings/org.sonarlint.eclipse.core.prefs Updates SonarCloud projectKey casing.
org.knime.python3.scripting.nodes/src/main/java/org/knime/python3/scripting/nodes2/PythonScriptingSession.java Adds gateway diagnostics for “Cannot obtain a new communication channel” conditions.
org.knime.python3.scripting.nodes/src/main/java/org/knime/python3/scripting/nodes2/PythonScriptNodeModel.java Improves user-facing error handling for “Cannot obtain…” Py4J exceptions.
org.knime.python3.scripting.nodes/META-INF/MANIFEST.MF Bundle version bump for scripting nodes.
org.knime.python3.scripting.nodes/.settings/org.sonarlint.eclipse.core.prefs Updates SonarCloud projectKey casing.
org.knime.python3.scripting.nodes.tests/pom.xml Revision bump for scripting nodes tests.
org.knime.python3.scripting.nodes.tests/META-INF/MANIFEST.MF Bundle version bump for scripting nodes tests.
org.knime.python3.scripting.nodes.tests/.settings/org.sonarlint.eclipse.core.prefs Updates SonarCloud projectKey casing.
org.knime.python3.nodes/src/main/python/knime/extension/parameter.py Dialog schema tweaks + datetime serialization/backward-compat adjustments.
org.knime.python3.nodes/src/main/java/org/knime/python3/nodes/proxy/NodeViewProxy.java Makes DataServiceProxy closeable.
org.knime.python3.nodes/src/main/java/org/knime/python3/nodes/extension/ExtensionNodeSetFactory.java Ensures data service proxy is closed when the request handler is closed.
org.knime.python3.nodes/src/main/java/org/knime/python3/nodes/ToolExecutor.java Makes ToolExecutor closeable and adds closed-state guard.
org.knime.python3.nodes/src/main/java/org/knime/python3/nodes/CloseablePythonNodeProxy.java Adds data service cleanup + temporary filestore handler switching for tool execution.
org.knime.python3.nodes/META-INF/MANIFEST.MF Bundle version bump for nodes.
org.knime.python3.nodes/.settings/org.sonarlint.eclipse.core.prefs Updates SonarCloud projectKey casing.
org.knime.python3.nodes.tests/src/test/python/unittest/test_environment_setting.py Updates proxy tests (credential escaping + no_proxy + translation cases).
org.knime.python3.nodes.tests/pom.xml Revision bump for nodes tests bundle.
org.knime.python3.nodes.tests/META-INF/MANIFEST.MF Bundle version bump for nodes tests.
org.knime.python3.nodes.tests/.settings/org.sonarlint.eclipse.core.prefs Updates SonarCloud projectKey casing.
org.knime.python3.nodes.py4j.dependencies/.settings/org.sonarlint.eclipse.core.prefs Updates SonarCloud projectKey casing.
org.knime.python3.arrow/META-INF/MANIFEST.MF Bundle version bump for arrow bundle.
org.knime.python3.arrow/.settings/org.sonarlint.eclipse.core.prefs Updates SonarCloud projectKey casing.
org.knime.python3.arrow.types/META-INF/MANIFEST.MF Bundle version bump for arrow types bundle.
org.knime.python3.arrow.types/.settings/org.sonarlint.eclipse.core.prefs Updates SonarCloud projectKey casing.
org.knime.python3.arrow.types.tests/pom.xml Revision bump for arrow types tests bundle.
org.knime.python3.arrow.types.tests/META-INF/MANIFEST.MF Bundle version bump for arrow types tests.
org.knime.python3.arrow.types.tests/.settings/org.sonarlint.eclipse.core.prefs Updates SonarCloud projectKey casing.
org.knime.python3.arrow.tests/pom.xml Revision bump for arrow tests bundle.
org.knime.python3.arrow.tests/META-INF/MANIFEST.MF Bundle version bump for arrow tests.
org.knime.python3.arrow.tests/.settings/org.sonarlint.eclipse.core.prefs Updates SonarCloud projectKey casing.
org.knime.features.python3.scripting/feature.xml Feature version bump + updated required feature version.
org.knime.features.python3.nodes/feature.xml Feature version bump.
org.knime.ext.py4j/.settings/org.sonarlint.eclipse.core.prefs Updates SonarCloud projectKey casing.
README.md Updates SonarCloud badge project key.
.lfsconfig Removes Git LFS configuration file.

AP-25563 (Investigate "Cannot obtain a new communication channel" Python failures)
@chaubold chaubold force-pushed the bug/AP-25563-cannot-obtain-communication-5.5 branch from f1f6bf9 to 5dda3cd Compare March 30, 2026 07:30
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.

3 participants