We’re attempting to make our deployment process a little less… disruptive, so we’d like to find a way of manually draining all open websockets.
Background
We’re running on AWS autoscaling groups with an Application Load Balancer. When we deploy, we register the a new instance with the load balancer target group, then deregister the old one. Unfortunately, target groups deregistration is ignorant of websockets, so it waits the 300s for all open connections to complete (which of course the websockets do not do), and then forcefully closes all of the connections. This causes a bit of a stampede (yes, yes, this is partly client issue, let’s just assume the clients are bad actors) and we much prefer to do this more gently.
Question
Is there any “official” way of traversing the open websockets and closing them down? Aside from spelunking through the Supervision tree that is.
Though I’m open to hearing about other options
.






















