Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 288175

Summary: numerous false incomings in task list after upgrade
Product: z_Archived Reporter: Robert Elves <robert.elves>
Component: MylynAssignee: Robert Elves <robert.elves>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P1 CC: overholt, robert.munteanu, thomas.ehrnhoefer, webmaster
Version: unspecified   
Target Milestone: 3.2.2   
Hardware: All   
OS: All   
URL: https://bugzilla.mozilla.org/show_bug.cgi?id=513989
Whiteboard:
Bug Depends on:    
Bug Blocks: 261868    
Attachments:
Description Flags
minimal fix
none
mylyn/context/zip
none
based on Steffen's algorithm
none
mylyn/context/zip
none
updated minimal fix
none
back-ported patch none

Description Robert Elves CLA 2009-08-31 15:38:58 EDT
Numerous false incomings appearing in my task list this morning.
Comment 1 Robert Elves CLA 2009-08-31 19:28:12 EDT
A server side work around that can be applied is to comment out the following code from buglist.cgi. Webmaster has been informed.

#
# If query was POSTed, clean the URL from empty parameters and redirect back to
# itself. This will make advanced search URLs more tolerable.
#
if ($cgi->request_method() eq 'POST') {
    $cgi->clean_search_url();

    print $cgi->redirect(-url => $cgi->self_url());
    exit;
}

I will post a patch shortly that resolves this multiple task retrieval issue then look into the timezone related incoming problem.
Comment 2 Robert Elves CLA 2009-08-31 19:33:55 EDT
Created attachment 146124 [details]
minimal fix

ensure request header fits within 8k
Comment 3 Robert Elves CLA 2009-08-31 19:33:59 EDT
Created attachment 146125 [details]
mylyn/context/zip
Comment 4 Steffen Pingel CLA 2009-08-31 20:08:01 EDT
Problem: Bugzilla versions < 3.4 (?) included a hard-coded time zone or no time zone information at all in the last modification date. Newer version support a user configurable time zone and format the time stamp accordingly. This can cause false incomings since time stamps are currently compared as strings.

Suggestion for migration of last modified time stamp:
1. Detect if modification date is a new time stamp

2a) old time stamp exits, repository uses old format
3. Compare by string

2b) old time stamp exits, repository now uses new format
3. Parse old time stamp as date
4. Compare old and new time stamps: assume no change if difference between old time and new time is an exact multiplier of 1 hour and in the range of +/- 24h
5. Store new time stamp in new attribute, remove old time stamp (how will that affect backwards compatibility?)

2c) new time stamp exits
3. Compare by date
Comment 5 Robert Elves CLA 2009-08-31 22:20:28 EDT
Created attachment 146140 [details]
based on Steffen's algorithm

Steffen, if you could sanity check this that would be great. I'm doing some testing here.
Comment 6 Robert Elves CLA 2009-08-31 22:20:37 EDT
Created attachment 146141 [details]
mylyn/context/zip
Comment 7 Steffen Pingel CLA 2009-08-31 23:31:32 EDT
First patch:
* Use a StringBuilder in preSynchronization()
* The condition should be if (syncSession.getData() == null.. instead of !=
Comment 8 Steffen Pingel CLA 2009-09-01 00:45:37 EDT
Created attachment 146144 [details]
updated minimal fix
Comment 9 Steffen Pingel CLA 2009-09-01 00:49:05 EDT
Created attachment 146145 [details]
back-ported patch
Comment 10 Steffen Pingel CLA 2009-09-01 04:03:57 EDT
Turns out that when a query is executed a redirect is now happening on the server which can result in a truncated request for large queries: When Mylyn makes a POST request for all changed bugs, the size of the request can exceed 8k. Bugzilla sanitizes the request and redirects to the result page using a url that is truncated to 8k. Since the parameters are stored in a map, the resulting url can consist of random portions of the original request sometimes resulting in the date range that is specified in the query getting dropped. In that case Bugzilla returns all queried tasks as changed.

If the following snippet is removed from buglist.cgi the redirect does not happen and the search will go through unaltered (and make queries faster, only requiring a single round trip):

bc.. 
#
# If query was POSTed, clean the URL from empty parameters and redirect back to
# itself. This will make advanced search URLs more tolerable.
#
if ($cgi->request_method() eq 'POST') {
    $cgi->clean_search_url();

    print $cgi->redirect(-url => $cgi->self_url());
    exit;
}
Comment 11 Robert Elves CLA 2009-09-01 15:58:22 EDT
Filed bug against Bugzilla:

   https://bugzilla.mozilla.org/show_bug.cgi?id=513989
Comment 12 Robert Elves CLA 2009-09-01 19:01:03 EDT
The fix for hundreds of incomings is now available in the weekly Mylyn build:

   http://eclipse.org/mylyn/downloads/#weekly

Webmaster is in the process of applying the temporary fix to bugs.eclipse.org/bugs. Will leave this bug open to track https://bugzilla.mozilla.org/show_bug.cgi?id=513989 and will now track the date comparison issue on bug 288309.
Comment 13 Robert Elves CLA 2009-09-02 16:28:47 EDT
Webmaster has applied the patch server side so that Eclipse.org Mylyn users who haven't or are unable to upgrade to the latest Mylyn weekly build will not hit this problem.
Comment 14 Steffen Pingel CLA 2009-09-02 18:19:20 EDT
I can confirm that Mylyn 3.0.5 which did not have support for handling the redirect now works again with Eclipse.org. Rob, are we done here?
Comment 15 Robert Elves CLA 2009-09-03 13:27:32 EDT
Fixed.
Comment 16 Andrew Overholt CLA 2009-09-03 13:39:17 EDT
Should I back-port something to Fedora's 3.2.1 package?  Steffen's back-ported patch, perhaps?
Comment 17 Steffen Pingel CLA 2009-09-03 20:03:36 EDT
The Mylyn 3.2.2 release is planned for SR1 on September 25th. Will you update the Fedora packages based on the Galileo SR1? I think that would be sufficient as only users with >1000 tasks in their task list will run into this problem.
Comment 18 Andrew Overholt CLA 2009-09-04 07:24:47 EDT
(In reply to comment #17)
> The Mylyn 3.2.2 release is planned for SR1 on September 25th. Will you update
> the Fedora packages based on the Galileo SR1? I think that would be sufficient
> as only users with >1000 tasks in their task list will run into this problem.

Yes, I'm planning on updating to SR1.  Thanks, Steffen.