Remix.run Logo
jrockway 5 days ago

I am not sure sync.Mutex fixes either of these problems. Press C-\ on a random Go server that's been up for a while and you'll probably find 3000 goroutines stuck on a Lock() call that's never going to return. At least you can time out channel operations:

   select {
   case <-ctx.Done():
          return context.Cause(ctx)
   case msg := <-ch:
          ...
   }