Project

General

Profile

Actions

Bug #3452

closed

rgw: Handling of dates in If-UnModified-Since / Last-Modified seems to have issues with timezones

Added by Sylvain Munaut over 11 years ago. Updated over 11 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Target version:
-
% Done:

0%

Source:
Community (user)
Tags:
Backport:
argonaut
Regression:
Severity:
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

So:
- I query an object and I get a header back saying "Last-Modified: Fri, 31 Aug 2012 11:12:49 GMT"
- I reissue the query with a "If-Unmodified-Since: Fri, 31 Aug 2012 11:12:49 GMT"

and in the rgw logs you find :

2012-11-07 16:49:58.275680 7f78f57ba700 10 If-UnModified-Since: 1346411569 Last-Modified: 1346407969

as you can see there is excatly 3600 seconds between them and I'm in a GMT+1 zone ... so something somewhere is wrong.

AFAICT, the 1346407969 is the right epoch, matching the string "Fri, 31 Aug 2012 11:12:49 GMT".
1346411569 is returned by parse_time when fed with this string and seems wrong but I'm not sure exactly why ...

BTW, when analyzing that codepath, I came across a use of gmtime instead of gmtime_r, patch attached. It doesn't solve the issue though.


Files

ceph-fix-gmtime-use.diff (667 Bytes) ceph-fix-gmtime-use.diff Patch in that code path but doesn't fix the issue ... Sylvain Munaut, 11/07/2012 08:48 AM
Actions #1

Updated by Sylvain Munaut over 11 years ago

I can confirm that commit:50d3598b fixes it for me.

I would still apply the patch attached to this issue to the tree as well though.

Actions #2

Updated by Yehuda Sadeh over 11 years ago

  • Backport set to argonaut
Actions #3

Updated by Yehuda Sadeh over 11 years ago

Yeah, definitely need to apply that patch.

Actions #4

Updated by Yehuda Sadeh over 11 years ago

  • Status changed from New to Resolved
Actions

Also available in: Atom PDF