Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 369607 - git log fails with "Task not found:" when you go back to it in browser history
Summary: git log fails with "Task not found:" when you go back to it in browser history
Status: RESOLVED FIXED
Alias: None
Product: Orion
Classification: ECD
Component: Server (show other bugs)
Version: 0.4   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 0.4 RC1   Edit
Assignee: Malgorzata Janczarska CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-24 18:07 EST by Susan McCourt CLA
Modified: 2012-02-02 11:14 EST (History)
2 users (show)

See Also:
simon_kaegi: review+


Attachments
proposed fix - adding no-store (859 bytes, text/plain)
2012-01-31 10:04 EST, Malgorzata Janczarska CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Susan McCourt CLA 2012-01-24 18:07:35 EST
I rather frequently get "Task not found:" error messages in git log, which requires me to reload the page.  I finally found a reproducible scenario.

- open a git log page.
- click on the commit link to see the commit
- now go back in browser history to the git log page.

You'll get a "task not found".
If you push reload quickly, it will usually still fail.
If you take a deep breath and count to 10 and reload, it will come back.
Comment 1 Malgorzata Janczarska CLA 2012-01-25 11:55:35 EST
I was only able to reproduce it on Chrome and I'm pretty sure that this is a symptom of a wider problem with Chrome.
The problem is that response for git log is retrieved from cache, although we add a non-cache header to the response. What is more other responses from our servlets are as well retrieved from cache, but the task is response is the only one that causes the real problem, because the task returned by the previous git log was deleted in meantime.
>If you push reload quickly, it will usually still fail.
>If you take a deep breath and count to 10 and reload, it will come back.
I had just the same problem, reloading with F5+F5 forced to get the correct response and everything worked fine.

Simon, do I remember correctly that it was you solving the cache problem before, by adding "Cache-Control: no-cache" to OrionServlet.writeJSONResponse?
It seems that Chrome doesn't respect the no-chache header, see this:
http://code.google.com/p/chromium/issues/detail?id=64139
I played a little with the scenario Susan found and it looks like adding "no-store" to Cache-Control header solved this problem, but this has a wide effect and I don't want to make this decision by myself.
What do you think about solving this by adding response.addHeader("Cache-Control", "no-store") to writeJSONResponse?
Alternatively I can use it only where we return information abut tasks, but I don't think we would like to risk caching other json responses.
Comment 2 Malgorzata Janczarska CLA 2012-01-25 12:02:06 EST
(In reply to comment #1)
> What do you think about solving this by adding
> response.addHeader("Cache-Control", "no-store") to writeJSONResponse?
Ah and I also think that we may justify no-store, because json responses may contain some information available to authenticated user, so may be considered as sensitive data.
Comment 3 Susan McCourt CLA 2012-01-25 13:52:34 EST
(In reply to comment #1)
> I was only able to reproduce it on Chrome and I'm pretty sure that this is a
> symptom of a wider problem with Chrome.

I was on Chrome too...sorry for not saying so.
Comment 4 Malgorzata Janczarska CLA 2012-01-26 12:59:52 EST
I tried to reproduce the caching problem in few places and it seems that it doesn't occur every time in Back. One other scenario I found requires Orion running in two browsers:
1. Open git status in Chrom and FF (need some files unstaged)
2. Stage a file in FF
3. On Chrome click on one of the commits in minilogs to open its details
4. Hit back on Chrome
5. Git status on Chrome does not contain the file staged in 2. as staged [BUG]
6. Refresh, still file is not staged [BUG]
7. Hard refresh (F5+F5). File is in staged
I doublechecked that git status response gas "no-cache" header set.
Comment 5 Malgorzata Janczarska CLA 2012-01-31 10:04:33 EST
Created attachment 210317 [details]
proposed fix - adding no-store
Comment 6 Malgorzata Janczarska CLA 2012-01-31 10:11:24 EST
Simon, as we talked on the call, I propose to fix this issue by adding no-store to our json responses (see patch), but I don't want to make this decision by myself, so I'm adding you on review. If you are ok with it I'll commit the "no-store" fix.
Comment 7 Simon Kaegi CLA 2012-02-02 11:05:38 EST
Go for it. At worst its correct but slower however from what I've seen it just looks like it's correct.
Comment 8 Malgorzata Janczarska CLA 2012-02-02 11:14:54 EST
Pushed.