I'm working on a project that uses GAE for datastore/services and Amazon S3 
for bulk data storage.  When using a HEAD request to S3 to verify an 
upload, we're getting this back from S3:

<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AccessDenied</Code><Message>Request has 
expired</Message><RequestId>[...]</RequestId><Expires>2012-10-29T22:36:55Z</Expires><HostId>[...]</HostId><ServerTime>2012-10-29T22:57:29Z</ServerTime></Error>

The timestamp on the GAE log was 2012-10-29 18:57:28.537 EDT (-4), so 
Amazon is reporting roughly the right time.

The problem is, that expiry on the request is set by:

System.currentTimeMillis() + (30*60*1000); // Add Half Hour expiration 
window


So that means that System.currentTimeMillis() returned 2012-10-29T22:06:55Z 
just a few seconds before Amazon responded.  A whole 51 minutes SLOW 
relative to current time / Amazon's clocks.  We saw this for several hours 
today, watching in horror as upload after upload failed to verify with 
drift between 38 and 55 minutes, varying on each request.

Now, we know there isn't any guarantee to the clock skew ( 
https://groups.google.com/forum/?fromgroups=#!topic/google-appengine/YwskAo2g-Ik
 
), but is there any preferred way to get a more accurate time than "within 
an hour"?  We've so far considered finding NTP libraries that will run in a 
service, hitting Amazon with a bogus request just to use the timestamp to 
build the real request, etc.  We could bump up the request expiry to a 
couple of hours, but if the drift keeps getting worse, we'll have to change 
that constant again and again, and I (and my co-workers) would like a more 
permanent fix than that.

Thoughts?

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine/-/1PgPrViOEVIJ.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to