Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WFCORE-6895] Add a grace period to Management CLI Installer Windows … #6071

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import java.io.IOException;
import java.util.Collection;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;

import org.jboss.as.cli.AwaiterModelControllerClient;
Expand Down Expand Up @@ -177,11 +176,6 @@ protected void doHandle(CommandContext ctx) throws CommandLineException {

if(isLocalClient) {
ctx.printLine("The JBoss CLI session will be closed automatically to allow the server be updated. Once the server has been restarted, you can relaunch the JBoss CLI session.", false);
try {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The wait in the startup scripts only applies to Windows scripts, but this wait happened also on Linux - is that OK to remove it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spyrkob thanks for commenting on it. It does nothing, it just waits a bit to have a better UX; you execute the command and see how it waits a bit with the message printed, that's all. It is safe to close it immediately.

TimeUnit.SECONDS.sleep(3);
} catch (InterruptedException e) {
// Ignored
}
// We are using a CLI which was launched from the server installation we have requested to be updated.
// In order to prevent keeping using a jboss-modules.jar that could have been updated, we finish the CLI process
// Once the server has been restarted the user will launch again the CLI that will use the most recent updates
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,9 @@ rem set "HOST_CONTROLLER_JAVA_OPTS=%HOST_CONTROLLER_JAVA_OPTS% -agentlib:jdwp=tr
rem # Sample JPDA settings for shared memory debugging
rem set "PROCESS_CONTROLLER_JAVA_OPTS=%PROCESS_CONTROLLER_JAVA_OPTS% -agentlib:jdwp=transport=dt_shmem,address=jboss,server=y,suspend=n"
rem set "HOST_CONTROLLER_JAVA_OPTS=%HOST_CONTROLLER_JAVA_OPTS% -agentlib:jdwp=transport=dt_shmem,address=jboss,server=y,suspend=n"

rem # Uncomment the following line to enable debug traces for the Management CLI script file
rem set "INST_MGR_SCRIPT_DEBUG=true"

rem # Uncomment the following line to configure the grace period (in seconds) before applying a candidate server
rem set "INST_MGR_SCRIPT_WINDOWS_COUNTDOWN=10"
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,12 @@ if ($HOST_CONTROLLER_JAVA_OPTS -eq $null) {
}

# Sample JPDA settings for remote socket debuging.
#PROCESS_CONTROLLER_JAVA_OPTS="$PROCESS_CONTROLLER_JAVA_OPTS -agentlib:jdwp=transport=dt_socket,address=8788,server=y,suspend=n"
#HOST_CONTROLLER_JAVA_OPTS="$HOST_CONTROLLER_JAVA_OPTS -agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n"
# $PROCESS_CONTROLLER_JAVA_OPTS="$PROCESS_CONTROLLER_JAVA_OPTS -agentlib:jdwp=transport=dt_socket,address=8788,server=y,suspend=n"
# $HOST_CONTROLLER_JAVA_OPTS="$HOST_CONTROLLER_JAVA_OPTS -agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n"

# Sample JPDA settings for shared memory debugging
#PROCESS_CONTROLLER_JAVA_OPTS="$PROCESS_CONTROLLER_JAVA_OPTS -agentlib:jdwp=transport=dt_shmem,server=y,suspend=n,address=jboss"
#HOST_CONTROLLER_JAVA_OPTS="$HOST_CONTROLLER_JAVA_OPTS -agentlib:jdwp=transport=dt_shmem,server=y,suspend=n,address=jboss"
# $PROCESS_CONTROLLER_JAVA_OPTS="$PROCESS_CONTROLLER_JAVA_OPTS -agentlib:jdwp=transport=dt_shmem,server=y,suspend=n,address=jboss"
# $HOST_CONTROLLER_JAVA_OPTS="$HOST_CONTROLLER_JAVA_OPTS -agentlib:jdwp=transport=dt_shmem,server=y,suspend=n,address=jboss"

# Uncomment the following line to configure the grace period (in seconds) before applying a candidate server
# $INST_MGR_SCRIPT_WINDOWS_COUNTDOWN=10
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ if "%INST_MGR_STATUS%" neq "PREPARED" (
goto EOF
)

IF NOT DEFINED %INST_MGR_COMMAND (
IF NOT DEFINED INST_MGR_COMMAND (
echo ERROR: Installation Manager command was not set.

goto EOF
Expand All @@ -52,6 +52,11 @@ set "INST_MGR_COMMAND=!INST_MGR_COMMAND:\\=\!"
setlocal DisableDelayedExpansion

set JAVA_OPTS=-Dlogging.configuration=file:"%INST_MGR_LOG_PROPERTIES%" %JAVA_OPTS%

IF NOT DEFINED INST_MGR_SCRIPT_WINDOWS_COUNTDOWN set INST_MGR_SCRIPT_WINDOWS_COUNTDOWN=10
echo Waiting %INST_MGR_SCRIPT_WINDOWS_COUNTDOWN% seconds before applying the Candidate Server...
timeout /T %INST_MGR_SCRIPT_WINDOWS_COUNTDOWN% /NOBREAK >nul

call %INST_MGR_COMMAND%
set INST_MGR_RESULT=%errorlevel%

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,15 @@ if ($INST_MGR_COMMAND -eq $null) {
$JAVA_OPTS="-Dlogging.configuration=file:$instMgrLogProperties $JAVA_OPTS"
Write-Host "$INST_MGR_COMMAND"

if ($INST_MGR_SCRIPT_WINDOWS_COUNTDOWN -eq $null) {
$INST_MGR_SCRIPT_WINDOWS_COUNTDOWN=10
}

try
{
Write-Host "Waiting $INST_MGR_SCRIPT_WINDOWS_COUNTDOWN seconds before applying the Candidate Server..."
Start-Sleep -Seconds $INST_MGR_SCRIPT_WINDOWS_COUNTDOWN

Invoke-Expression "& $INST_MGR_COMMAND 2>&1"

$exitCode = if ($?) {0} else {1}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,9 @@ rem set "DISABLE_JDK_SERIAL_FILTER=true"
rem # Uncomment to add a Java agent. If an agent is added to the module options, then jboss-modules.jar is added as an agent
rem # on the JVM. This allows things like the log manager or security manager to be configured before the agent is invoked.
rem set "MODULE_OPTS=-javaagent:agent.jar"

rem # Uncomment the following line to enable debug traces for the Management CLI script file
rem set "INST_MGR_SCRIPT_DEBUG=true"

rem # Uncomment the following line to configure the grace period (in seconds) before applying a candidate server
rem set "INST_MGR_SCRIPT_WINDOWS_COUNTDOWN=10"
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,6 @@ if (-Not $JAVA_OPTS) {
# Uncomment to add a Java agent. If an agent is added to the module options, then jboss-modules.jar is added as an agent
# on the JVM. This allows things like the log manager or security manager to be configured before the agent is invoked.
# $MODULE_OPTS="-javaagent:agent.jar"

# Uncomment the following line to configure the grace period (in seconds) before applying a candidate server
# $INST_MGR_SCRIPT_WINDOWS_COUNTDOWN=10