risingwavelabs/risingwave · error
internal error: entered unreachable code
Error message
internal error: entered unreachable code
What it means
An `unreachable!()` panic in `NotificationManager::delete_sender`. The match on `WorkerType` handles Frontend, ComputeNode/RiseCtl, and Compactor, so hitting the wildcard arm means the worker key resolved to a WorkerType the code did not anticipate (e.g. Meta or a future/new variant).
Solutions
- Identify the WorkerType value reaching the wildcard arm (add logging or inspect worker registration) and handle it in the match.
- If a new WorkerType variant was added, update `delete_sender` (and sibling matches) to route it to the correct sender map or explicitly ignore it.
- Reject/ignore deregistration attempts for worker types that never register senders (e.g. Meta) instead of panicking.
Example fix
// before WorkerType::Compactor => core_guard.compactor_senders.remove(&worker_key), _ => unreachable!(), // after WorkerType::Compactor => core_guard.compactor_senders.remove(&worker_key), WorkerType::Meta => None, // no sender map to delete _ => None,
Defensive patterns
Strategy: try-catch
Validate before calling
// this panics, not returns — guard before calling by checking the worker type
fn deletable(t: WorkerType) -> bool {
matches!(t, WorkerType::Frontend | WorkerType::ComputeNode | WorkerType::RiseCtl | WorkerType::Compactor)
} Type guard
fn is_sender_backed(t: &WorkerType) -> bool {
!matches!(t, WorkerType::Meta)
} Try / catch
// panic-based: cannot catch; instead ensure callers only pass known variants
if !is_sender_backed(&worker_type) { return; } // skip deregistration Prevention
- Keep WorkerType match arms exhaustive in all notification manager functions
- After adding a WorkerType variant, run `cargo check` to surface non-exhaustive matches
- Never deregister worker types that do not own senders
When it happens
Trigger: Calling `delete_sender` for a worker whose `WorkerType` is `Meta` or any newly introduced variant not covered by the match arms in notification.rs:280-287.
Common situations: Rust version/dependency change adds a WorkerType variant; internal cluster tooling registering as Meta worker then deregistering; a bug passing the wrong worker type to delete_sender.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- notification stopped or uninitialized
- All valid CDC connectors should have returned by now
- BatchPosixFsReader should not hit this branch. refer to…
- failed to parse relation definition
- Failed to retrieve fragment description: fragment
AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11).
Data as JSON: /api/errors/9406a1d5df7ab4e9.
Report an issue: GitHub.
Appendix: source
Thrown at src/meta/src/manager/notification.rs:286
tracing::warn!(error = %err.as_report(), "Failed to notify local subscriber");
return false;
}
true
});
}
/// Tell `NotificationManagerCore` to delete sender.
pub fn delete_sender(&self, worker_type: WorkerType, worker_key: WorkerKey) {
let mut core_guard = self.core.lock();
// TODO: we may avoid passing the worker_type and remove the `worker_key` in all sender
// holders anyway
match worker_type {
WorkerType::Frontend => core_guard.frontend_senders.remove(&worker_key),
WorkerType::ComputeNode | WorkerType::RiseCtl => {
core_guard.hummock_senders.remove(&worker_key)
}
WorkerType::Compactor => core_guard.compactor_senders.remove(&worker_key),
_ => unreachable!(),
};
}
/// Tell `NotificationManagerCore` to insert sender by `worker_type`.
pub fn insert_sender(
&self,
subscribe_type: SubscribeType,
worker_key: WorkerKey,
sender: UnboundedSender<Notification>,
) {
let mut core_guard = self.core.lock();
if core_guard.exiting {
tracing::warn!("notification manager exiting.");
return;
}
let senders = core_guard.senders_of(subscribe_type);
senders.insert(worker_key, sender);View on GitHub (pinned to 6469eb736d)