twitchdev / issues

Issue tracker for third party developers.
Apache License 2.0
72 stars 7 forks source link

[Conduits] PATCH conduit does not properly "delete" shards #914

Open Marenthyu opened 4 months ago

Marenthyu commented 4 months ago

Brief description Under certain circumstances, Conduits do not seem to "scale down" as described in the documentation, keeping shards above the maximum shard count "alive" instead.

How to reproduce

  1. Create a Conduit with 2 Shards
  2. Connect 2 WebSocket Transports to the Shards
  3. Disconnect WebSocket with Shard ID 0 (unsure at the time of writing if required)
  4. Scale down Conduit to 1 Shard
  5. Observe unchanged Conduit Status

Expected behavior Shard with ID 1 should have been disabled/deleted and either a "status" of "deleted", "scaled_down" or similar should be set or not be present in the list of shards anymore.

Additional context or questions Refer to Discussion on Discord in #eventsub-help

BarryCarlyon commented 4 months ago

To add a smidge of clarity on this one and a repo case:

  1. Create a conduit
  2. Subscribe some stuff to the conduit (chat probably works best as "noisy")
  3. Give the conduit two shards
  4. Assign those shards
  5. Wait for data and confirm both shards getting data
  6. Scale the conduit down to 1 shard
  7. All data is moved to the first shard, so the second shard is "effectivly disabled"
  8. Shard 2 still shows in the Get Conduit Shards API but is still "enabled" however is not being sent data (which is good, no "leaks" per sae)
  9. In this case shard 2 is a websocket, I kill the websocket and the shard becomes websocket_disconnected in the shards response

So, in summary, when you scale down using "reduce shard count"