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

Bug 234243

Summary: Error in Process Explorer (swim caching is not working)
Product: Community Reporter: Eike Stepper <stepper>
Component: Project Management & PortalAssignee: Portal Bugzilla Dummy Inbox <portal-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: critical    
Priority: P4    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Eike Stepper CLA 2008-05-27 16:25:05 EDT
https://dev.eclipse.org/portal/myfoundation/tests/swim.php?file=ipzilla/reuse_existing_orbit_package.txt&lines=7

-->

reuse existing orbit package

Trouble: PHP Warning:
file(scripts/finished/reuse_existing_orbit_package.txt) [function.file]: failed to open stream: No such file or directory
/home/apps/myfoundation/myfoundation/tests/swim.php (250)

Trouble: PHP Warning:
Invalid argument supplied for foreach()
/home/apps/myfoundation/myfoundation/tests/swim.php (254)
Comment 1 Bjorn Freeman-Benson CLA 2008-05-28 02:39:25 EDT
Assigning to Karl.
Something is wrong with the swim/swim caching in the deployment process. It looks like the relative path to the test is incorrect? Run seems to work fine, but both run and swim use the same code:

if ($_GET['file']) {
	$file = $_GET['file'];
 	$path = "scripts/$file";
...
$lines = file($path);

The code all works on my dev box (run and swim).

I'd need some kind of debug permissions on production boxes to look into it, so instead I'm assigning this to Karl (who has those permissions).
Comment 2 Karl Matthias CLA 2008-05-28 12:36:41 EDT
working on it
Comment 3 Karl Matthias CLA 2008-05-28 12:45:36 EDT
allswim.pl was broken due to PHP style comments that were preventing it from running properly.  Additionally it was not able to report errors so I added that.  Still investigating how old cache files got in the directory.  The release scripts properly delete them.  I'm looking for some other way they could get written.
Comment 4 Karl Matthias CLA 2008-05-28 12:54:46 EDT
Ok I figured it out.  The swim.php doesn't write whole filenames.  It writes _basenames_ and since the allswim.pl was failing the first file request that was made for a filename with the same _basename_ was written to the cache (ie "finished/blahblahblah.txt" rather than "bugzilla/blahblahblah.txt").  There are links all over the web to old versions of the files.  Most of those were apparently not hit from our site, but via external links (blog entries, etc).  The error messages generated from those incorrect links were cached instead. I think we should fix swim.php to use whole filenames so this can't happen again.  Otherwise, even if we run them at release time there is still a race condition that could cause this to happen again.  Since the tests are slow to run I think that's a significant time window in which the wrong file could be cached.  The down side of doing that is that with the current system, if the files were properly cached, those broken links all over the net would still work.  If we use full paths, they won't.  Now that they are cached, try hitting: 

https://dev.eclipse.org/portal/myfoundation/tests/swim.php?file=finished/reuse_existing_orbit_package.txt&lines=7

It actually works because the cache just looks up basenames, not filenames.  Your call, Bjorn, on whether we fix the race condition or not.
Comment 5 Karl Matthias CLA 2008-05-28 12:56:00 EDT
Actually I thought of another solution: don't ever cache a file that contains "Trouble: ".  I'll implement that.
Comment 6 Karl Matthias CLA 2008-05-28 14:34:53 EDT
Implemented.  Will be available in next release of the portal code.
Comment 7 Bjorn Freeman-Benson CLA 2008-05-28 16:29:27 EDT
(In reply to comment #5)
You made my day with that bit of obviousness - doh, why didn't I think of that :-)
Comment 8 Karl Matthias CLA 2008-05-28 18:18:24 EDT
(In reply to comment #7)
> (In reply to comment #5)
> You made my day with that bit of obviousness - doh, why didn't I think of that
> :-)


:)  Well as you can see it was not obvious to me at first, either. :)
Comment 9 Bjorn Freeman-Benson CLA 2008-05-28 20:45:33 EDT
(In reply to comment #4)
> Your call, Bjorn, on whether we fix the race condition or not.

I think we should fix it.  And then we should put in a bit of code that reports a better "not found" error: perhaps it says "I'm sorry, we have refactored our site and that link is no longer valid." and then sends them to the list of all tests so that they can find the test case they are interested in.

(Reopened. Unless you've already done that, in which case you can re-close.)
Comment 10 Bjorn Freeman-Benson CLA 2008-08-21 13:04:21 EDT
Changing to P4 for the "better error message" portion.
Comment 11 Wayne Beaton CLA 2012-04-02 22:46:36 EDT
Marking as WONTFIX. We're not doing any further development on the Developer Portal.