My GoLang AppEngine code is uncompressing a ZIP file and then saving off each file as BlobStore content. I've seen it take over 30 seconds to save the data and then it fails with "API error 10 (file: FILE_NOT_OPENED)." The size of the uncompressed file being written is about 1.5 megabytes. Here is the code that does the copy to a new BlogStore item from the Zip reader:
func storeBlob(c appengine.Context, rc io.Reader, mimeType string) (appengine.BlobKey, error) {
c.Infof("Creating new blob of type: [%v]", mimeType)
var key appengine.BlobKey
w, err := blobstore.Create(c, mimeType)
if err != nil {
return "", err
}
c.Infof("Copying blob data")
_, err = io.Copy(w, rc)
if err != nil {
return "", err
}
c.Infof("Closing Blob")
err = w.Close()
if err != nil {
return "", err
}
c.Infof("Getting Blob Key")
key, err = w.Key()
if err != nil {
return "", err
}
return key, nil
}
The production appengine server locks up for 30 seconds and then reports the error on the io.Copy call. Any thoughts on how to troubleshoot this?