Bug 1071379 - CTRL+C doesn't shutdown server when running in console mode on Windows
Summary: CTRL+C doesn't shutdown server when running in console mode on Windows
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: Launch Scripts
Version: JON 3.2,JON 3.2.1
Hardware: All
OS: Windows
unspecified
medium
Target Milestone: ER04
: JON 3.3.0
Assignee: Jay Shaughnessy
QA Contact: Sunil Kondkar
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-02-28 15:58 UTC by Larry O'Leary
Modified: 2014-12-11 14:00 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-12-11 14:00:43 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Larry O'Leary 2014-02-28 15:58:05 UTC
This issue was originally reported by QE when testing bug 889012

--- Additional comment from Sunil Kondkar on 2014-02-28 06:27:40 EST ---

Tested on JON 3.2.1 DR01 build (Build Number :c758688:4c03150) on Windows server 2008 with 32 bit JAVA 6 JRE.

1.Installed JBoss ON 3.2.1 DR01 build with - rhqctl.bat install
2.Started the services with - rhqctl.bat start
3.Stopped the server using - rhqctl.bat stop --server
4.Started server in console mode with rhqctl.bat console --server

5. After starting server in console mode on windows terminal, issued <CTRL-C>
6. It displayed - Terminate batch job <Y/N>? ( pressed Y)

There are no exceptions in server log and server does not hang, however, issuing <CTRL-C> on terminal does not stop the server. The server can be stopped after killing the java.exe process using windows task manager. 

Reopening the bug as issuing <CTRL-C> on windows terminal does not stop the server.

Comment 1 Jay Shaughnessy 2014-09-05 21:41:16 UTC
I couldn't reproduce this on Win7.  I started server with:

> rhqctl console --server

Using 64-bit Java7.


The Java process went away as expected after the CTL-C and 
Terminate batch job <Y/N>? ( pressed Y)

Setting to ON_QA

Comment 2 Larry O'Leary 2014-09-08 02:18:39 UTC
ON_QA doesn't make any sense. No fix was performed.

Assigning to Jay and marking as CLOSED WORKSFORME as per comment 1. If QE/Sunil/Jay believe this bug is still valid, please re-open with more details.

Comment 3 Jay Shaughnessy 2014-09-08 21:17:44 UTC
I'm actually going to re-open this, now I'm not so sure I didn't end up with a rogue wrapper process...

Comment 4 Jay Shaughnessy 2014-09-16 16:01:22 UTC
master commit f46c56be49e97add1bd8e4d6cf0c78d5df6c1aed
Author: Jay Shaughnessy <jshaughn>
Date:   Tue Sep 16 11:58:00 2014 -0400

    Rhqctl was actually the program running in the foreground
    when the 'rhqctl console --server' command was issued. The JSW and Server
    processes were also running, but in the background.  When issuing a
    CTRL-C it was actually rhqctl that was getting interrupted and killed. The
    CTRL-C was not reaching the wrapper, or the server.  This got a little
    infuriating because even if you manually killed the Server, the wrapper
    would detect the "crasg" and then spin up a new server process :)  So, to
    recover you needed to manually kill the wrapper.exe process, and then
    manually kill the RHQ Server process.

    With the fix we now launch a new cmd window for the Server (asynchronously,
    via the Windows start command) which allows rhqctl to complete and exit.
    The wrapper is now running in the foreground of the new window, and CTRL-C
    is handled as expected by JSW (shutdown), as is double CTRL-C (immediate
    shutdown).

    Analogous work done for --storage.  Note that we don't support 'rhqctl
    console --agent' and already direct users to run rhq-agent.bat directly.


release/jon3.3.x commit bc60b86e0c61495db9e6b818363ff2b65151db98
Author: Jay Shaughnessy <jshaughn>
Date:   Tue Sep 16 11:58:00 2014 -0400

    (cherry picked from commit f46c56be49e97add1bd8e4d6cf0c78d5df6c1aed)
    Signed-off-by: Jay Shaughnessy <jshaughn>

Comment 5 Simeon Pinder 2014-10-01 21:32:57 UTC
Moving to ON_QA as available for test with build:
https://brewweb.devel.redhat.com/buildinfo?buildID=388959

Comment 6 Sunil Kondkar 2014-10-09 13:37:02 UTC
Verified on JON3.3 ER04 on Windows 2008.

rhqctl.bat console --server opens a new cmd windows and <CTRL+C> in the new cmd windows works.


Note You need to log in before you can comment on or make changes to this bug.