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-6894 Extract interfaces from SuspendController appropriate for its consumers #6117

Merged
merged 9 commits into from
Sep 10, 2024

Conversation

pferraro
Copy link
Contributor

@pferraro pferraro commented Jul 24, 2024

https://issues.redhat.com/browse/WFCORE-6894

  • Reimplemented SuspendController using CompletableFutures and concurrent data structures
  • SuspendableActivity interface replaces ServerActivity
    • Adds context to suspend/resume methods
    • New interface better facilitates non-blocking implementations (e.g. the ability to report exceptions from async operations) and provides more control over suspend process
  • Extracted SuspendableActivityRegistry interface from SuspendController
    • Single purpose interface for use by subsystems needing to register suspendable activity
    • Define suspend priority (f.k.a. "execution group") during registration (since this must not change between executions), replaces ServerActivity.getExecutionGroup()
  • Extracted ServerSuspendController interface from SuspendController for use by suspend/resume/shutdown operations
    • New suspend/resume method signature removes the need for temporary OperationListener registration to determine suspend/resume completion/timeout.
  • Deprecated public methods of SuspendController not exposed by ServerSuspendController interface
  • Remove usage of deprecated SuspendController methods in wildfly-core

@github-actions github-actions bot added the deps-ok Dependencies have been checked, and there are no significant changes label Jul 24, 2024
@pferraro pferraro force-pushed the WFCORE-6894 branch 3 times, most recently from 3973ccb to 6c8f8cb Compare July 29, 2024 14:54
@pferraro pferraro added the hold Do not merge this PR label Aug 1, 2024
@pferraro
Copy link
Contributor Author

pferraro commented Aug 1, 2024

Adding hold label while I experiment with ServerSuspendContoller API changes to better accommodate non-blocking server activity.

@wildfly-ci

This comment was marked as off-topic.

@wildfly-ci

This comment was marked as off-topic.

@wildfly-ci

This comment was marked as off-topic.

@wildfly-ci

This comment was marked as off-topic.

@wildfly-ci

This comment was marked as off-topic.

@wildfly-ci

This comment was marked as off-topic.

@wildfly-ci

This comment was marked as off-topic.

@wildfly-ci

This comment was marked as off-topic.

@pferraro pferraro requested review from bstansberry and yersan and removed request for bstansberry August 6, 2024 14:42
…ntation.

Reimplement SuspendController to better accommodate non-blocking server activity and simplify timeout behavior.
Provide context to activity suspend/remove calls.
Replace GracefulShutdownService with static reference to CompletionStage of final suspend operation.
@@ -314,7 +313,6 @@ protected void boot(final BootContext context) throws ConfigurationPersistenceEx
}
}
context.getServiceTarget().addService(SUSPEND_CONTROLLER_CAPABILITY.getCapabilityServiceName(), suspendController)
.addDependency(JBOSS_SERVER_NOTIFICATION_REGISTRY, NotificationHandlerRegistry.class, suspendController.getNotificationHandlerRegistry())
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just in case anyone is also reviewing this. This effectively makes the SuspendController stop waiting for JBOSS_SERVER_NOTIFICATION_REGISTRY, but we are fine with it, since we think NotificationHandlerRegistry is an orphan relationship used in the past.

Comment on lines +1102 to +1110
default void suspendingServer(long timeout, TimeUnit unit) {
if (timeout > 0) {
ServerLogger.ROOT_LOGGER.suspendingServer(TimeUnit.MILLISECONDS.convert(timeout, unit));
} else if (timeout < 0) {
ServerLogger.ROOT_LOGGER.suspendingServerWithNoTimeout();
} else {
ServerLogger.ROOT_LOGGER.suspendingServer();
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice!

@yersan yersan added the ready-for-merge This PR is ready to be merged and fulfills all requirements label Sep 10, 2024
@yersan yersan merged commit 386233c into wildfly:main Sep 10, 2024
12 checks passed
@yersan
Copy link
Collaborator

yersan commented Sep 10, 2024

Thanks @pferraro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deps-ok Dependencies have been checked, and there are no significant changes ready-for-merge This PR is ready to be merged and fulfills all requirements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants