FluidFramework icon indicating copy to clipboard operation
FluidFramework copied to clipboard

QoS Report Unhandled Rejection: ComponentRuntime disposed while this ack-based Promise was pending

Open ruchika-m opened this issue 6 years ago • 2 comments

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

ruchika-m avatar Jul 07 '20 15:07 ruchika-m

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

wes-carlson avatar Jul 10 '20 00:07 wes-carlson

Here is my assessment:

  1. all users of ConsensusOrderedCollectioon.submit() can deal with undefined result instead of rejected promise and not propagate errors to user
  2. ConsensusRegistryCollection.write() can handle early return too.

vladsud avatar Jul 14 '20 22:07 vladsud