Describe the bug
The Discovery domain does not reschedule lazily executed Tasks when stopping. The trace for this is as follows:
Discovery.start is called to register handlers onto TaskManager before it starts processing.
TaskManager.startProcessing is called to start task processing.
- The
Discovery.discoverVertexHandler is executed lazily.
TaskManager.stopProcessing is called in order to stop task processing.
Discovery.discoverVertexHandler catches an ErrorTaskStop on ctx.signal.reason.
- It calls
Discovery.scheduleDiscoveryForVertex to reschedule the task.
Discovery.scheduleDiscoveryForVertex calls TaskManager.getTasks, seeing that the task that is currently executing cleanup already exists.
- The new task is not rescheduled.
TaskManager.startProcessing is called, the task to resume discovery is not executed.
To Reproduce
As the code to reproduce this only exists within the context of my Discovery domain pagination changes, please refer to
|
test('identity discovery persistence across restarts', async () => { |
Expected behavior
The discovery task should be rescheduled so that discovery of vertices can be resumed after restarts.
Screenshots
Platform (please complete the following information)
- Device: [e.g. iPhone6]
- OS: [e.g. iOS]
- Version [e.g. 22]
Additional context
Found whilst working on #716
Notify maintainers
@tegefaulkes
Describe the bug
The
Discoverydomain does not reschedule lazily executedTasks when stopping. The trace for this is as follows:Discovery.startis called to register handlers ontoTaskManagerbefore it starts processing.TaskManager.startProcessingis called to start task processing.Discovery.discoverVertexHandleris executed lazily.TaskManager.stopProcessingis called in order to stop task processing.Discovery.discoverVertexHandlercatches anErrorTaskStoponctx.signal.reason.Discovery.scheduleDiscoveryForVertexto reschedule the task.Discovery.scheduleDiscoveryForVertexcallsTaskManager.getTasks, seeing that the task that is currently executing cleanup already exists.TaskManager.startProcessingis called, the task to resume discovery is not executed.To Reproduce
As the code to reproduce this only exists within the context of my
Discoverydomain pagination changes, please refer toPolykey/tests/discovery/Discovery.test.ts
Line 494 in 167b041
Expected behavior
The discovery task should be rescheduled so that discovery of vertices can be resumed after restarts.
Screenshots
Platform (please complete the following information)
Additional context
Found whilst working on #716
Notify maintainers
@tegefaulkes