Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(110)

Issue 1689060: Ignore bad date from remote server

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years, 7 months ago by zhoresh
Modified:
15 years, 7 months ago
Reviewers:
johnfargo, dev-remailer
Base URL:
http://svn.apache.org/repos/asf/shindig/trunk
Visibility:
Public.

Description

We run into a case that remote server would return date that is off by 30 minutes when fetching data. This then cause our server to fetch the resource every time. (the resource was still served to user and cached, but on next retrieval from cache it was dropped and fetched again). So the fix is to compare the date on the response and if too old (configured) it will be ignored and shindig server time will be used.

Patch Set 1 #

Total comments: 2

Patch Set 2 : Sync to head and fix according to comments #

Total comments: 1

Patch Set 3 : I only experience the server legging behind, but you right should check both way, ptal #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+40 lines, -15 lines) Patch
java/gadgets/src/main/java/org/apache/shindig/gadgets/http/HttpResponse.java View 1 2 11 chunks +23 lines, -11 lines 1 comment Download
java/gadgets/src/test/java/org/apache/shindig/gadgets/http/HttpResponseTest.java View 1 4 chunks +17 lines, -4 lines 0 comments Download

Messages

Total messages: 8
zhoresh
15 years, 7 months ago (2010-07-29 23:08:55 UTC) #1
johnfargo
Looks like the patch got out of sync. svn up and repatch. thx! http://codereview.appspot.com/1689060/diff/1/3 File ...
15 years, 7 months ago (2010-07-30 01:00:07 UTC) #2
zhoresh
Sync to head and fix according to comments
15 years, 7 months ago (2010-07-30 01:23:14 UTC) #3
johnfargo
http://codereview.appspot.com/1689060/diff/10001/5003 File java/gadgets/src/main/java/org/apache/shindig/gadgets/http/HttpResponse.java (right): http://codereview.appspot.com/1689060/diff/10001/5003#newcode460 java/gadgets/src/main/java/org/apache/shindig/gadgets/http/HttpResponse.java:460: if (timestamp < (currentTime - responseDateDriftLimit)) { this logic ...
15 years, 7 months ago (2010-07-30 02:20:49 UTC) #4
zhoresh
I only experience the server legging behind, but you right should check both way, ptal
15 years, 7 months ago (2010-07-30 02:26:49 UTC) #5
johnfargo
LGTM in general. Would be nice to see both greater-than-limit and less-than-limit tests. http://codereview.appspot.com/1689060/diff/15001/16002 File ...
15 years, 7 months ago (2010-07-30 03:24:56 UTC) #6
zhoresh
On Thu, Jul 29, 2010 at 8:24 PM, <johnfargo@gmail.com> wrote: > LGTM in general. Would ...
15 years, 7 months ago (2010-07-30 06:06:14 UTC) #7
johnfargo
15 years, 7 months ago (2010-07-30 06:25:02 UTC) #8
Yep, oops, just misread the test there. Looks good.

On Thu, Jul 29, 2010 at 11:05 PM, Ziv Horesh <zhoresh@gmail.com> wrote:

>
> On Thu, Jul 29, 2010 at 8:24 PM, <johnfargo@gmail.com> wrote:
>
>> LGTM in general. Would be nice to see both greater-than-limit and
>> less-than-limit tests.
>>
> Will add the test
>
>>
>>
>> http://codereview.appspot.com/1689060/diff/15001/16002
>>
>> File
>>
>> java/gadgets/src/main/java/org/apache/shindig/gadgets/http/HttpResponse.java
>> (right):
>>
>> http://codereview.appspot.com/1689060/diff/15001/16002#newcode460
>>
>>
>>
java/gadgets/src/main/java/org/apache/shindig/gadgets/http/HttpResponse.java:460:
>> if (responseDateDriftLimit < Math.abs(currentTime - timestamp)) {
>> don't you want > here? :)
>
> Nope, we want to use shindig date if the time is off by more then the
> allowed drift. (and the test should prove it).
> Maybe if I will reverse the order it will make more sense: if (Diff >
> allowed drift) then ignore response time.
>
>
>
>>
>> http://codereview.appspot.com/1689060/show
>>
>
>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b