Hi Piotr, On Wed, Jan 20, 2010 at 7:33 AM, Piotr Sikora <[email protected]>wrote:
> Hi Nick, > thanks for reply, but I must disagree ;) > > > 500 is the correct response to return in this case, as the URL the user >> requested (your handler script) was found, while the blobkey returned by >> your script was not valid. >> > > You assume that there is some URL-to-blob_key mapping done, which is not > always the case. > I don't assume any such thing. Your code asking the infrastructure to send the user a non-existent blob is an issue with your code, not with the user's request, and as such, it should return a 500 status code, not a 404. -Nick Johnson > > For example, I made my Blobstore data available at "/blob/<blob_key>". At > the moment I verify that <blob_key> really exists by getting its BlobInfo > and I return 404 when it doesn't, but in my opinion, this should be > required. > > Also, since this is distributed system, race condidion is always possible, > because concurrent request can delete <blob_key> from the Blobstore at any > time, which means that in such case: > > REQ1: client: GET /blob/valid_blob_key > REQ1: handler: b = BlobInfo.get(valid_blob_key) > REQ1: handler: b exists > > REQ2: client: GET /delete/valid_blob_key > REQ2: handler: BlobInfo.delete(valid_blob_key) > REQ2: handler: return 200 OK > REQ2: client: 200 OK received > > REQ1: handler: set_header(BLOB_KEY_HEADER, b.key()) > REQ1: handler: return 200 OK > REQ1: client: 500 Internal Server Error received > > client will receive 500 Internal Server Error with Google's default error > page (not even ours). > > > Error codes should make sense from the client's >> point of view, not the server's. >> > > Yes, and that's exactly what I mean. From client's perspective data at > "/url" was not found. > > Also, please note, that from all the things I wrote in my original e-mail, > this is the smallest issue ;) > > > Best regards, > Piotr Sikora < [email protected] > > > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<google-appengine%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-appengine?hl=en. > > > > -- Nick Johnson, Developer Programs Engineer, App Engine Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration Number: 368047--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
