Hi Vinny,

Thanks for your suggestions. As a redhead, I'll try not to take offence to 
that :)

I have been working with app engine only for a couple of months, so all 
code is relatively new. My *guess* is that I've been having a similar issue 
pretty much from the start, it just took me a while to debug it (I think I 
was being fooled by log messages prior to me flushing them). However, I was 
originally working with the blobstore. Since I was having issues and that 
has become deprecated, I switched to GCS - and have been having this exact 
problem since.

I tried switching back to regular backends and removing my modules - same 
behaviour.

I tried your suggestion of writing a single character, closing the file and 
trying the larger write:

        gcs_file = cloudstorage.open(filename, 'w', content_type=
'text/plain' )
        self.debugMessage("opened file")
        gcs_file.write("f")
        self.debugMessage("One character written")
        gcs_file.close()
        self.debugMessage("file closed. Sleeping")

        time.sleep(int(suffix) * 10)

        gcs_file = cloudstorage.open(filename, 'w', content_type=
'text/plain')
        self.debugMessage("opened file")
        gcs_file.write("f" * 1024 * 1024 * 1 + '\n')
        self.debugMessage("data written")
        gcs_file.close()
        self.debugMessage("file closed")

I ran this three times (10 instances each time) - in all cases the file is 
written with the single character successfully, but a number of the larger 
writes then hang.

I also enabled AppStats. However, it looks to me like the requests that 
hang never reach the state of writing the AppStat log (e.g. I never see 
something like "Saved; key: __appstats__:073900, part: 29 bytes, full: 1364 
bytes" in the log), so I am not sure how that will be useful. Nonetheless, 
I modified the AppStat code to allow public access (this is a test 
application, no sensitive data), so if you wish to do so, you can check for 
yourself at http://benstoragetest.appspot.com/stats

Thanks for your input,
Ben

On Wednesday, September 11, 2013 2:45:04 AM UTC+1, Vinny P wrote:
>
> On Tue, Sep 10, 2013 at 5:14 AM, Ben Smithers 
> <smithe...@googlemail.com<javascript:>
> > wrote:
>
>> Has anyone else observed this behaviour? Does anyone have any suggestions 
>> for what I am doing wrong?
>>
>>
>
> Backends are the red headed stepchild of GAE - they exhibit weird behavior 
> periodically. Did these errors start happening recently, or is this new 
> code? If you're using the Modules version of backends, can you try using 
> regular backends (and not defining any modules whatsoever)?
>
> Can you try seeing what an AppStats profile of this request looks like? 
> Here's the link: 
> https://developers.google.com/appengine/docs/python/tools/appstats . 
> Specifically, what I'm looking for is whether the library is hanging during 
> the connection to GCS, and what the connection information looks like.
>
> If you don't want to install AppStats, you can also try splitting up file 
> creation and writing to the file: create the file through the GCS library, 
> write a single character, then close the connection. Sleep for a bit, then 
> try writing to the file. The problem might isolate itself to a particular 
> part of the file writing process.
>   
> -----------------
> -Vinny P
> Technology & Media Advisor
> Chicago, IL
>
> App Engine Code Samples: http://www.learntogoogleit.com
>   
>    
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to