Queue kernel input events #5474
Replies: 1 comment
-
@dckc and I found another need for this today: the If this "I'm ready" input occurs in the middle of some existing crank, things could get confused: the run-queue message will be part of the same state delta as the existing crank. If that crank were rolled back for whatever reason, the "dynamic vat is ready" message would be discarded as well. This becomes more likely to happen when all vats are running on The solution will be to route this "worker process is ready" event through the same input queue that we want for The other reason we want the kernel to have an input queue is for device inputs. One example is the "mailbox device", whose external API surface includes a function which the host can call when data arrives from a remote machine (perhaps in the POST handler of an HTTP server). The device reacts to this arrival by adding a message to the run-queue, which means changing kernel state, which runs all the risks described above for vat worker startup. Currently, cosmic-swingset has an external queue for this purpose, but we should move it into the kernel proper. This overlaps with device setup (#1351) because we want the external API surface to be routed through the kernel's input queue. That would be easier if we knew what that surface was. I'm thinking the device construction function should return an object which properties are API functions, but the controller wraps each function in the input queue interlock before revealing the wrappers to the caller. Then e.g. the webserver could call That "input handling window" should probably be immediately after each crank is complete, after the state is committed. The window should have its own DB transaction (flush the |
Beta Was this translation helpful? Give feedback.
-
@warner and I discovered that there were reentrancy problems with the
ag-solo
inbound command processing. The general solution to reentrancy is to create a SwingSet input queue, as is hinted at in #710We may want to adopt a queuing mechanism as part of SwingSet so that other hosts don't have the same problems by construction.
Beta Was this translation helpful? Give feedback.
All reactions