QoS Report Unhandled Rejection: ComponentRuntime disposed while this ack-based Promise was pending
Describe the bug
This error showed up as a top hitter on the QoS Report. The impact shows across different apps, I used the following query to look at all the different apps/audiences the impact is across
union kind = outer (Office_Fluid_OfficeWebHost_Error | where Data_eventName == "UnhandledError" or Data_eventName == "UnhandledRejection"), (Office_Fluid_OfficeWebHost_Activity_LoadComponentInDiv | where Data_inIframe=="false" | where Activity_Success=="false"),
(Office_Fluid_OfficeWebHost_Activity_LoadComponentInIframe | where Activity_Success=="false"), (Office_Fluid_App_Error | where Data_isQoSError=="true")
| where App_Version != '1234' or App_Version != 'NaN'
| where todatetime(Event_Time) >= ago(7d)
| where Data_message contains "ComponentRuntime disposed while this ack-based Promise was pending"
| summarize count(), any(Data_stack) by Data_message, Data_eventName, Data_subErrorName, Data_hostName, App_Version, Release_AudienceGroup
To Reproduce
Don't have a repro, since I am seeing this in the telemetry
It seems this is happening because the promise returned by AgentScheduler.pick() will reject if the runtime is disposed while the promise is pending (since newAckBasedPromise usage was added to ConsensusRegisterCollection). This is not being handled in ContainerRuntime.subscribeToLeadership(): https://github.com/microsoft/FluidFramework/blob/master/packages/runtime/container-runtime/src/containerRuntime.ts#L1716
This will also affect other users of AgentScheduler/TaskManager. Vlad has suggested eating this rejection earlier and not exposing it on pick().
@vladsud @markfields @agarwal-navin
Here is my assessment:
- all users of ConsensusOrderedCollectioon.submit() can deal with undefined result instead of rejected promise and not propagate errors to user
- ConsensusRegistryCollection.write() can handle early return too.