Open bstrzelecki opened 1 month ago
I believe the current design assumes that threading is only done on Go's side - i.e. the batches are spread across multiple threads (workers) but you can't do concurrent calls to Send*Batch
functions.
I don't think this is consistent with the code comments (which probably reflect my original intentions) I see in GameEngine's code though - it does mention the possibility of concurrently calling Send*Batch
for different game IDs. I don't think that's what you're doing here (you seem to be trying to do concurrent calls for same game ID) but I imagine we'd get the same/similar failures, if we were to test with different game IDs as well since we don't hold a lock over some of the engine's structures when, for example, we delete games at the end of the request.
Considering that we were planning on playing a lot of games at the same time, the assumption that only one Python thread can operate on a single game ID still seems reasonable to me but we will almost for sure need to allow concurrent calls to Send*Batch
for different game IDs.
Sending requests form multiple threads (e.g.) fails with folllowing error: