AP-25563 cannot obtain communication channel - backport to 5.5#94
Open
chaubold wants to merge 2 commits intoreleases/2025-07from
Open
AP-25563 cannot obtain communication channel - backport to 5.5#94chaubold wants to merge 2 commits intoreleases/2025-07from
chaubold wants to merge 2 commits intoreleases/2025-07from
Conversation
Contributor
chaubold
commented
Mar 30, 2026
- 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)
Contributor
There was a problem hiding this comment.
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
|→ Pythonno_proxytranslation) 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. |
org.knime.python3/src/main/java/org/knime/python3/QueuedPythonGatewayFactory.java
Outdated
Show resolved
Hide resolved
AP-25563 (Investigate "Cannot obtain a new communication channel" Python failures)
f1f6bf9 to
5dda3cd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.