Open turadg opened 1 year ago
The subscriber in kit returned by makeERecorderKit is "durable" but made anew. https://github.com/Agoric/agoric-sdk/blob/3ce0599d5173b802598b5bedf57d3c30f016f789/packages/zoe/src/contractSupport/recorder.js#L174-L181
subscriber
makeERecorderKit
So in auctioneer, after restart this would return a different subscriber: https://github.com/Agoric/agoric-sdk/blob/3ce0599d5173b802598b5bedf57d3c30f016f789/packages/inter-protocol/src/auction/auctioneer.js#L658-L661
And the old one, being durable, would persist but not get any new records.
The other place this is a problem: https://github.com/Agoric/agoric-sdk/blob/3ce0599d5173b802598b5bedf57d3c30f016f789/packages/inter-protocol/src/vaultFactory/vaultDirector.js#L251-L254
We could pass the durable publish kit in,
const makeERecorderKit = ( { publisher, subscriber }, storageNodeP, valueShape, ) => { const recorderP = E.when(storageNodeP, storageNode => makeRecorder(publisher, storageNode, valueShape), ); return { subscriber, recorderP }; };
const schedulePublishKit = provide(baggage, 'schedulePublishKit', () => makeDurablePublishKit(), ); const scheduleKit = makeERecorderKit( schedulePublishKit, E(privateArgs.storageNode).makeChildNode('schedule'), /** * @type {import('@agoric/zoe/src/contractSupport/recorder.js').TypedMatcher< * import('./scheduler.js').ScheduleNotification * >} */ (M.any()), );
Even if it's durable, there are no references left to it, right? Won't it get GC'd eventually?
Describe the bug
The
subscriber
in kit returned bymakeERecorderKit
is "durable" but made anew. https://github.com/Agoric/agoric-sdk/blob/3ce0599d5173b802598b5bedf57d3c30f016f789/packages/zoe/src/contractSupport/recorder.js#L174-L181So in auctioneer, after restart this would return a different subscriber: https://github.com/Agoric/agoric-sdk/blob/3ce0599d5173b802598b5bedf57d3c30f016f789/packages/inter-protocol/src/auction/auctioneer.js#L658-L661
And the old one, being durable, would persist but not get any new records.
The other place this is a problem: https://github.com/Agoric/agoric-sdk/blob/3ce0599d5173b802598b5bedf57d3c30f016f789/packages/inter-protocol/src/vaultFactory/vaultDirector.js#L251-L254
Additional context
We could pass the durable publish kit in,