FluidFramework icon indicating copy to clipboard operation
FluidFramework copied to clipboard

assert in ContainerRuntime.processSignal

Open vladsud opened this issue 7 years ago • 7 comments

We are seeing this critical error in telemetry. I believe this is assert in ContainerRuntime.processSignal, and it's likely a race condition between creation of component and signal on it. Tavir, can you please take a look?

If fix is trivial (I assume we want to ignore that case), having it in release/0.11 would be great.

fluid:telemetry:Container:onError undefined == true AssertionError: undefined == true at ge.processSignal (https://officefluidprodversionedcdn.azureedge.net/3304901/app/officeFluidContainer.js:99:7993) at w.processSignal (https://officefluidprodversionedcdn.azureedge.net/3304901/app/bohemia.js:133:1958) at ce.processSignal (https://officefluidprodversionedcdn.azureedge.net/3304901/app/bohemia.js:176:15183) at Object.processSignal (https://officefluidprodversionedcdn.azureedge.net/3304901/app/bohemia.js:176:12305) at x.worker (https://officefluidprodversionedcdn.azureedge.net/3304901/app/bohemia.js:154:2291) at x.processDeltas (https://officefluidprodversionedcdn.azureedge.net/3304901/app/bohemia.js:148:1358) at x.push (https://officefluidprodversionedcdn.azureedge.net/3304901/app/bohemia.js:148:526) at O. (https://officefluidprodversionedcdn.azureedge.net/3304901/app/bohemia.js:154:8716) at O.s.emit (https://officefluidprodversionedcdn.azureedge.net/3304901/app/bohemia.js:22:9139) at O. (https://officefluidprodversionedcdn.azureedge.net/3304901/app/bohemia.js:145:1367)

vladsud avatar Nov 26 '19 17:11 vladsud

That's pretty high in the list of errors, so fix is needed before public preview on 12/5

vladsud avatar Nov 26 '19 17:11 vladsud

Actually, very easy to repro: Create a new Bohemia doc Very quickly after creation click on the doc and start typing.

In this case there are no collaborators (single user), so it's not very clear why assert fires.

vladsud avatar Nov 26 '19 21:11 vladsud

Arin, any chance you can poke a bit more here? I believe the right fix here is to ignore signals in such state, but I want to double check that's correct flow.

Here is what i see:

  • assert happens for "defaultComponent". It's not in the list, while we have 8 components in there.
  • when I debug through flow, all components are created, including "defaultComponent", then we load context, and signal comes as we process attach ops - defaultComponent might be not there (time permitting).

What I do not understand:

  • I see two reloads of context. Why? They look like having same code proposal. I think it's summarizer (secondary container), we are created new doc, so we are connected right away. That would also explain why app does not "see" this error (that we raised on container) - it raised on summarizing container.
  • In general, what should be the workflow for critical errors on summarizing container? Currently, we rely on app to close container when critical error is raised on main container (though, if error is coming from DeltaManager, we close it ourselves as well). When error is hit on summarizing container, there is nobody to close it, so I think we should fix it and restart summarizer.

@ashwinmayya - FYI

vladsud avatar Nov 27 '19 04:11 vladsud

Vlad, I believe replacing the assert with a bypass (ignore signal) is the correct fix. Any time a component is added, it can show up earlier (attach message) for some clients who might send a signal. As long as we don't try to make any guarantees like "all connected clients will get signals for their components"

  • Correct: 2 reloads on a new document is normal, second is for the summarizer. It makes sense that the second client actually gets the signal error, since the first is probably the one sending it before the summarizer has a chance to read the attach message.
  • Probably a good question. This specific error happens in DeltaQueue -> DeltaManager -> Container "critical error" but doesn't cause summarizer container to close.
    • It feels to me like it could be analogous to main container errors, so whenever an agent/summarizer container is created by a parent/main container, the creating container should be able to listen to the created container's "error" event. Then it can decide to close the container in most cases (like summarizer case). Right now Loader.request() does not return the created container in cases of canCache false, but maybe it should?
    • Another option is for each agent code to close itself, sort of how summarizer handles most errors now. But we would need to propagate container "error" event down to the runtime as opposed to up to the creating container.
    • So either propagate error up (first option), down (second option), or close itself at same level in the container (not sure if it should always close on critical error?)

What do you think?

arinwt avatar Nov 27 '19 06:11 arinwt

To be honest, I do not have strong preference on solution here (for container errors). I think it should get closed on any critical error, but mechanism wise - not sure.

For signals specifically, I think we want to follow up with more robust design here. I worry that as we add more features (including container reload on version bump), there would be more cases where signals get lost, and some user-facing features stopped working correctly. Should be there a mechanism to let sender / receiver know they missed something, such that they can have recovery mechanism?

I feel like we want to split this issue into multiple and keep tracking them separately - neither is blocking, but we need to get to the bottom of them

vladsud avatar Nov 27 '19 17:11 vladsud

Created issue #681 for closing summarizer/agent containers on critical error. Created issue #682 for following up on signals addressed to components that aren't found.

arinwt avatar Nov 27 '19 20:11 arinwt

Closing, as original problem is addressed, and issues are opened for follow up items

vladsud avatar Dec 10 '19 16:12 vladsud