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

Bug 201898

Summary: intermittently see start and stop recording problems
Product: z_Archived Reporter: jkubasta
Component: TPTPAssignee: DuWayne Morris <dmorris>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P1 CC: endres, paulslau
Version: unspecifiedKeywords: plan
Target Milestone: ---   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description jkubasta CLA 2007-08-31 09:16:39 EDT
1. selected the Tester role in the Welcome page
2. switched to a Test perspective
3. selected File->New->Other
4. expanded Test and then Recording
5. selected HTTP Proxy Recorder
6. specified a file name of httprec1
7. selected Finish
8. in the IE external web browser that appeared changed the URL from about:blank to www.eclipse.org
   and hit Enter
9. when the page was done displaying, I selected the Stop Recording toolbar button in the Recorder Control view in the Test perspective

RESULT:
A Registry Editor window appeared with the following text:
"Cannot import IEConfig.reg: Error opening the file. There may be a disk or file system error."

NOTE: 
Here's what appeared in the consolelog window before hitting the Stop Recording button:
============================================================================
vmArgs:
agent classpath: org.eclipse.hyades.execution.recorder.http.remote.SSLProxyRecor
der
about to load recorder agent: org.eclipse.hyades.execution.recorder.http.remote.
SSLProxyRecorder
load successful
about to initialize recorder agent: org.eclipse.hyades.execution.recorder.http.r
emote.SSLProxyRecorder
initialization successful
about to start SSLProxyServer

and here's what appeared after hitting the Stop Recording button:
==================================================================
"C:\Program Files\Internet Explorer\iexplore.exe"
recorder stopper thread started with name: Recorder Process Stopper
about to wait for process
proxy recorder listening to port1080
Interrupted
Error Binding to Port:1080 Exception: java.net.SocketException: socket closed
        at java.net.PlainSocketImpl.socketAccept(Native Method)
        at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:379)
        at java.net.ServerSocket.implAccept(ServerSocket.java:471)
        at org.eclipse.hyades.execution.recorder.http.remote.PeekServerSocket.ac
ceptPeekSocket(PeekServerSocket.java:72)
        at org.eclipse.hyades.execution.recorder.http.remote.SSLProxyRecorder$Pr
oxy.run(SSLProxyRecorder.java:147)
Trace file: /testproj/httprec11.rec

I attached this trace file.



WORKAROUND:
close the IE web browser that was launched for recording.
Comment 1 jkubasta CLA 2007-08-31 09:17:17 EDT
Reported by product team.  Please see if reproducible on 441
Comment 2 Paul Slauenwhite CLA 2007-09-24 07:54:33 EDT
I could not reproduce this defect using the 4.4.0.3 driver (Europa fall maintenance release candidate).


Duwayne, please look at the code (PeekServerSocket.java:72) to determine if we can handle the closed socket more elegantly.  Also, please provide an estimated sizing.
Comment 3 DuWayne Morris CLA 2007-09-26 15:20:42 EDT
Not sure, but it looks like there are some potential problems in winding down when using the "stop recording" button.  In working on a Vista defect, for example, I noticed that cleanup gets called twice.  The reason is that the RecorderClient.java class calls the appadapter stop method, which in the case of IE, calls Process.destroy().  This results in breaking out of the wait state in the recorder stopper, which in turn call the recorder client stopRecording method which then call stop again (resulting in a second call to cleanup).

There may also be some funny things that happen due to calling interrupt on the RecorderStopper in addition to destroying the process.  Destroying the process should be adequate by itself, since that will force a breakout from the wait state.

In any case, it looks like this defect should be addressed by reviewing the logic and simplifying the execution path in a logical manner that is more bullet proof.  Obviously, since there are multiple execution adapters for IE, FireFox, etc., one must be cautious to make sure other browsers do not get broken by fixing IE.

Adding a sizing estimate to include testing various browsers.
Comment 4 Paul Slauenwhite CLA 2008-01-07 11:46:14 EST
Deferring to I6.
Comment 5 DuWayne Morris CLA 2008-03-13 15:49:20 EDT
Added logic in RecorderClient.java to prevent appadapter cleanup from being called twice.  There evidently was a race where the RecorderStopper class could end up calling StopRecording after StopRecording is called by the user clicking the stop button.  By tightening control in the RecorderClient, this effectively eliminates the need to modify the individual appadapter classes and prevents the problem of cleanup being called twice, which is a problem I had seen happen under the debugger.  The interrupt of the RecorderStopper thread should be fine now with the added controls.  It is simply a matter of making sure the Recorder Stopper object gets terminated and cleaned up. 
Comment 6 DuWayne Morris CLA 2008-06-04 16:43:49 EDT
Have not seen any further problems with this since it was fixed.  Marking as verified.
Comment 7 DuWayne Morris CLA 2008-06-09 09:10:29 EDT
Fixed and verified, closing.