jupyter / tmpnb

Creates temporary Jupyter Notebook servers using Docker containers. [DEPRECATED - See BinderHub project]
https://github.com/jupyterhub/binderhub
BSD 3-Clause "New" or "Revised" License
528 stars 123 forks source link

set status code 429 when pool is full #283

Closed minrk closed 7 years ago

minrk commented 7 years ago

rather than replying with 200 when the request failed

cc @jasongrout

jasongrout commented 7 years ago

I don't think 429 is appropriate. That is for rate-limiting requests, and indicates the request is not being processed because "The user has sent too many requests in a given amount of time." However, what you're really trying to indicate here is that the request was handled, but the server is out of resources.

jasongrout commented 7 years ago

After more conversation on gitter, I concede that 429 could be considered appropriate. From https://tools.ietf.org/html/rfc6585:

Note that this specification does not define how the origin server identifies the user, nor how it counts requests.

I suppose you're defining the "user" as "everyone that is sending me requests" and counting requests as "compared to the server resources available"

minrk commented 7 years ago

Thanks for talking this through with me! I agree that 429 isn't perfect, but it seems the best fit among no perfect choices.