bensivo / salad-bowl

The classic party game Salad Bowl, implemented in golang and next.js
0 stars 0 forks source link

BUG: Concurrent write to websocket connection causes service to crash #8

Open bensivo opened 1 year ago

bensivo commented 1 year ago

image

Can be reproduced by just running the e2e test suite multiple times in parallel.

In one terminal

docker-compose up

In another terminal

cd e2e
for i in {0..10}; do; npm run test &; done
bensivo commented 1 year ago

Potential solution: Instead of directly exposing the websocket "send" function, expose a write channel. Then, use a goroutine to read from that channel and write to the websocket.