effect icon indicating copy to clipboard operation
effect copied to clipboard

Scheduler Goes Rogue

Open ryanleecode opened this issue 1 year ago • 0 comments

What version of Effect is running?

3.1.2

What steps can reproduce the bug?

  1. Clone https://github.com/paritytech/substrate-connect/tree/rogue-scheduler
  2. corepack pnpm i
  3. cd packages/light-client-experimental
  4. corepack pnpm turbo build
  5. pnpm dlx tsx scripts/testing.ts
  6. 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

ryanleecode avatar May 08 '24 17:05 ryanleecode