effect
effect copied to clipboard
Scheduler Goes Rogue
What version of Effect is running?
3.1.2
What steps can reproduce the bug?
- Clone https://github.com/paritytech/substrate-connect/tree/rogue-scheduler
- corepack pnpm i
- cd packages/light-client-experimental
- corepack pnpm turbo build
- pnpm dlx tsx scripts/testing.ts
- Wait like 5-10 minutes until you see the console flooded with
13:21:17 (Fiber #285) INFO chainhead -> polkadot-2 Chainhead disconnected
13:21:22 (Fiber #285) ERROR chainhead -> polkadot-2 [{"code":-32800,"name":"RpcError"},"too many active follow subscriptions"]
What is the expected behavior?
This schedule should always work as expected
Effect.retry(
$(
Schedule.union(
Schedule.exponential("500 millis"),
Schedule.spaced("5 seconds"),
),
Schedule.jittered,
),
)
What do you see instead?
It randomly goes rogue and seems to convert to Schedule.forever
Additional information
Refer to this as the scheduler:
https://github.com/paritytech/substrate-connect/blob/rogue-scheduler/packages/light-client-experimental/src/rpc-client/chainhead.ts#L96