cog icon indicating copy to clipboard operation
cog copied to clipboard

Server reports "Already running a prediction" during setup

Open evilstreak opened this issue 2 years ago • 3 comments

It should say it's doing setup and isn't ready, instead!

evilstreak avatar Mar 23 '23 17:03 evilstreak

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

mattt avatar Jun 21 '23 12:06 mattt

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.

nickstenning avatar Jun 21 '23 14:06 nickstenning

Does anyone know how long it takes to Cog for starting up the first time when running it in a Docker container?

Pankaj-Samyak avatar Mar 27 '25 06:03 Pankaj-Samyak