Server reports "Already running a prediction" during setup
It should say it's doing setup and isn't ready, instead!
It looks like this was introduced by #944 with these lines:
https://github.com/replicate/cog/blob/dfff002e275cdb6af8af4cc290e976813a4a8735/python/cog/server/runner.py#L57-L59
@nickstenning Would it make sense to raise a different error here?
Also, it looks like is_busy has side effects here, which I wasn't expecting... Is that right?
https://github.com/replicate/cog/blob/dfff002e275cdb6af8af4cc290e976813a4a8735/python/cog/server/runner.py#L141-L142
Yes, that's right. It looks weird, and isn't terribly elegant, but note that you can't reach those lines unless it's actually not busy.
The smallest fix here is probably to return a different message with the 409 based on the value of app.state.health.
Does anyone know how long it takes to Cog for starting up the first time when running it in a Docker container?