GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: avoid deadlock when changeNamespaces joins a populated shared informer by csviri · Pull Request #3655 · operator-framework/java-operator-sdk

Conversation

@csviri

@csviri csviri commented Oct 22, 2026 •
edited by coderabbitai Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

Fabric8 replays an already populated informer's cache to a newly added
handler synchronously, on the registering thread. changeNamespaces
registered the handler on an informer starter thread while the event
source held its monitor waiting for that thread, so the replay blocked
on the monitor and deadlocked. Register the handlers on the calling
thread and only start the informers in parallel.

Fixes #3650

Summary by CodeRabbit

  • Bug Fixes
    • Improved namespace changes for active informers when cached events are replayed during handler registration.
    • Newly added namespaces are watched, and events from them can be handled without the namespace change hanging.
    • Informer startup now proceeds reliably when joining an already populated namespace, allowing replayed events to reach their handlers.
  • Tests
    • Added regression coverage confirming the namespace change completes within 10 seconds and delivers the replayed event.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Copilot AI balanced review requested due to automatic review settings October 22, 2026 13:19
@openshift-ci
openshift-ci Bot requested review from metacosm and xstefank October 22, 2026 13:19
@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2afc4ca9-428c-493d-bd92-b8425d9ba631
📥 Commits

Reviewing files that changed from the base of the PR and between e6bb598 and 72e7bbc.

📒 Files selected for processing: 2
  • operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/informer/InformerManager.java
  • operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/source/informer/ManagedInformerEventSourceNamespaceChangeTest.java

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

📝 Walkthrough

changeNamespaces now prepares namespace informer wrappers before executor tasks start them. A regression test covers synchronous cache replay during a namespace change and checks that the new namespace is watched and its event is handled.

Changes: Namespace changes

Layer / File(s) Summary
Informer startup and cache replay
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/informer/InformerManager.java, operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/source/informer/ManagedInformerEventSourceNamespaceChangeTest.java
changeNamespaces creates and registers namespace wrappers before submitting them to the executor. The test simulates synchronous replay of an existing resource during handler registration and checks that the namespace change completes, the namespace is watched, and the event handler receives an event.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 72e7b

The namespace-change deadlock path is covered by the new test, with no actionable merge-blocking risk identified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the primary change: preventing a deadlock when changeNamespaces joins a populated shared informer.
Linked Issues check Passed Issue #3650 requires namespace changes to complete when a new namespace joins a populated shared informer, while preserving event delivery and normal stop behavior. `InformerManager.changeNamespaces()…
Out of Scope Changes check Passed The changes remain within issue #3650. The production change only moves handler registration before parallel informer startup and updates related task logging. The test adds deadlock regression covera…
Full details: Linked Issues check

Explanation

Issue #3650 requires namespace changes to complete when a new namespace joins a populated shared informer, while preserving event delivery and normal stop behavior. InformerManager.changeNamespaces() now creates each InformerWrapper and registers its handler on the calling thread before it waits for parallel informer startup. The regression test simulates synchronous cache replay, applies the namespace change with a timeout, verifies the new namespace and event delivery, and stops the event source.

Full details: Out of Scope Changes check

Explanation

The changes remain within issue #3650. The production change only moves handler registration before parallel informer startup and updates related task logging. The test adds deadlock regression coverage and refactors shared informer setup for that coverage. No unrelated change is demonstrated.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Copilot started reviewing on behalf of csviri October 22, 2026 13:19
View session
@csviri
csviri force-pushed the fix/change-namespaces-deadlock branch from 0eac016 to e6bb598 Compare October 22, 2026 13:20
Copilot AI reviewed Oct 22, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused fix removes the reported lock cycle, preserves lifecycle synchronization and parallel startup, and includes targeted regression coverage.

No open issues 🎉

What changed in this PR

Fixes #3650 by avoiding a deadlock when changeNamespaces() joins a populated shared informer in the core event-source runtime.

Changes:

  • Registers handlers on the calling thread so synchronous cache replay can reenter the event-source monitor.
  • Keeps informer startup parallel.
  • Adds a regression test that simulates synchronous cache replay and verifies namespace changes complete and deliver an event.
File Description
operator-framework-core/​src/​test/​java/​io/​javaoperatorsdk/​operator/​processing/​event/​source/​informer/​ManagedInformerEventSourceNamespaceChangeTest.java Adds deadlock regression coverage and shared test helpers.
operator-framework-core/​src/​main/​java/​io/​javaoperatorsdk/​operator/​processing/​event/​source/​informer/​InformerManager.java Moves handler registration before parallel informer startup.

Review effort: Balanced

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@csviri
fix: avoid deadlock when changeNamespaces joins a populated shared in…
72e7bbc
…former

Fabric8 replays an already populated informer's cache to a newly added
handler synchronously, on the registering thread. changeNamespaces
registered the handler on an informer starter thread while the event
source held its monitor waiting for that thread, so the replay blocked
on the monitor and deadlocked. Register the handlers on the calling
thread and only start the informers in parallel.

Fixes #3650
@csviri
csviri force-pushed the fix/change-namespaces-deadlock branch from e6bb598 to 72e7bbc Compare October 22, 2026 14:33
@csviri
csviri merged commit 01b307e into main Oct 23, 2026
33 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@csviri
csviri deleted the fix/change-namespaces-deadlock branch October 23, 2026 09:10
@coderabbitai coderabbitai Bot mentioned this pull request Nov 4, 2026
feat!: upgrade Fabric8 to 8.0.0 and support Jackson 3 #3673
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@metacosm metacosm Awaiting requested review from metacosm
@xstefank xstefank Awaiting requested review from xstefank

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

ChangeNamespaces deadlocks when joining a populated shared informer

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@csviri
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.