Skip to content

provider_timeout-fix: Added logic to fast fail in some additional path - #950

Open
Vinodsathyaseelan wants to merge 1 commit into
3.3.rcfrom
provider_timeout-fix
Open

Vinodsathyaseelan wants to merge 1 commit into
3.3.rcfrom
provider_timeout-fix

Conversation

@Vinodsathyaseelan

Copy link
Copy Markdown
Contributor

when provider is not for specific app or broadcast use case.

What

What does this PR add or remove?

Why

Why are these changes needed?

How

How do these changes achieve the goal?

Test

How has this been tested? How can a reviewer test it?

Checklist

  • I have self-reviewed this PR
  • I have added tests that prove the feature works or the fix is effective

when provider is not for specific app or broadcast use case.
Copilot AI lite review requested due to automatic review settings September 11, 2026 00:01
@github-actions

Copy link
Copy Markdown

Code Coverage

Package Line Rate Health
core.sdk.src.service.mock_app_gw.appgw 0% ❌
device.thunder_ripple_sdk.src 13% ❌
core.tdk.src.utils 0% ❌
core.main.src.bootstrap.manifest 0% ❌
core.sdk.src.framework 64% ➖
core.sdk.src.processor 9% ❌
core.main.src.state.cap 42% ❌
core.sdk.src.api.gateway 69% ➖
core.sdk.src.utils 58% ➖
core.main.src.broker 69% ➖
core.main.src.broker.thunder 37% ❌
core.main.src.processor.storage 0% ❌
device.thunder_ripple_sdk.src.bootstrap 0% ❌
core.sdk.src.extn 76% ✔
core.main.src.service.apps 33% ❌
core.main.src.utils 28% ❌
core.main.src.service.ripple_service 9% ❌
core.main.src.broker.test 90% ✔
core.sdk.src.extn.ffi 0% ❌
core.tdk.src.gateway 100% ✔
device.thunder_ripple_sdk.src.processors 19% ❌
core.sdk.src.extn.client 81% ✔
core.sdk.src.api.observability 57% ➖
core.main.src.broker.rules 78% ✔
device.thunder_ripple_sdk.src.client 61% ➖
core.sdk.src.api.device 75% ✔
core.main.src.bootstrap.extn 0% ❌
core.main.src.processor 0% ❌
core.main.src.state 36% ❌
core.main.src 0% ❌
core.main.src.firebolt 13% ❌
core.sdk.src.api.distributor 29% ❌
core.sdk.src.api.firebolt 85% ✔
core.main.src.service 32% ❌
core.sdk.src.api.manifest 74% ➖
core.main.src.bootstrap 0% ❌
core.sdk.src.api 44% ❌
core.main.src.service.extn 25% ❌
core.sdk.src.service 65% ➖
device.thunder_ripple_sdk.src.events 43% ❌
core.main.src.firebolt.handlers 12% ❌
device.thunder_ripple_sdk.src.processors.events 0% ❌
core.sdk.src.manifest 0% ❌
core.sdk.src.service.mock_app_gw 0% ❌
device.mock_device.src 56% ➖
Summary 50% (21977 / 44211) ➖

Minimum allowed line rate is 48%

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Two moderate issues involving stale listeners can prevent reliable fast failure.

Pull request overview

Adds fast-failure handling when no suitable provider is available, avoiding unnecessary timeouts.

Changes:

  • Adds checks for app-specific and broadcast requests.
  • Centralizes fast-failure responses and logging.
  • Reuses fast-failure handling when no provider exists.
File summaries
File Summary Findings
core/main/src/service/apps/provider_broker.rs Adds provider availability checks and fast-failure responses. Moderate (1 vote): Checks may match stale listeners rather than active provider registrations, allowing requests to wait for the timeout. Moderate (1 vote): Listener counts may include stale listeners and prevent fast failure when no provider can respond.
Review details

Suppressed comments (2)

core/main/src/service/apps/provider_broker.rs:265

  • This tests only for any listener with the target app ID, not for an active provider registration. unregister_provider removes the provider method but does not remove its AppEvents listener, so with another provider registered for the same method an app-specific request can pass here, emit_to_app sends to the stale/non-provider listener, and the caller still waits for the timeout. Remove provider listeners during unregister/cleanup or validate this against the active provider registration before starting the session.
                    if !AppEvents::is_app_registered_for_event(
                        pst,
                        app_id.clone(),
                        &event_name,
                    ) {

core/main/src/service/apps/provider_broker.rs:276

  • The count includes stale listeners, so it does not establish that a provider can respond. For example, after one provider unregisters (leaving its listener behind) and the currently registered provider disconnects, this remains nonzero and emit broadcasts to the stale listener instead of fast-failing; the caller can still wait the full timeout. Count only listeners tied to active provider registrations, or fix listener cleanup before relying on this guard.
                    let listener_count =
                        AppEvents::get_listeners(&pst.app_events_state, &event_name, None).len();
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

This branch has not been deployed

No deployments
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.

2 participants