-
Notifications
You must be signed in to change notification settings - Fork 471
[WFCORE-6843] Logging a WARN if a deployment's runtime name doesn't have an extension #6340
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your very quick response and sorry for the late response, I overlooked that. I will look at it now. Thanks for the information. :) |
2f2cb16
to
ac61cc4
Compare
server/src/main/java/org/jboss/as/server/logging/ServerLogger.java
Outdated
Show resolved
Hide resolved
...-controller/src/main/java/org/jboss/as/domain/controller/logging/DomainControllerLogger.java
Outdated
Show resolved
Hide resolved
...va/org/jboss/as/domain/controller/operations/deployment/ServerGroupDeploymentAddHandler.java
Outdated
Show resolved
Hide resolved
This comment was marked as outdated.
This comment was marked as outdated.
ac61cc4
to
dac24f1
Compare
This comment was marked as outdated.
This comment was marked as outdated.
if (!deploymentUnitName.contains(".")) { | ||
DEPLOYMENT_NAMECHECK_LOGGER.deploymentsRuntimeNameWithoutExtension(managementName, deploymentUnitName); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last detail, we need to do the same for the other methods as redeploy
, replace
The same applies to Domain Mode handlers, we need to cover the redeploy
and replace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @yersan,
I looked at it, and I pushed my changes, but I would like to ask about redeploy in domain mode.
I am not entirely sure if I got that right, but I assume that in domain mode, when talking about redeployment, we mean operation deployment-overlay, and it has to do with DomainDeploymentOverlayRedeployLinksHandler, right?
If that is the case, I think it is not possible to change the runtime name of the deployment, or am I mistaken?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when talking about redeployment, we mean operation deployment-overlay, and it has to do with DomainDeploymentOverlayRedeployLinksHandler, right?
It is not related to the overlay functionality. We are talking here about the redeploy
operation under /server-group=*/deployment=*
resource. The handler is ServerGroupDeploymentRedeployHandler
but according to the code, it seems that the operations there are redirected directly to the managed servers, so I think we are not going to be able to do something easy with it. Being a redeploy that does not change the runtime name, I think we will be ok with it. In addition, the server handler will be already prepared to log the trace in the managed server JVM, so, that's fine with me.
dac24f1
to
ef17283
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@khermano I took anothe look today, domain mode is a bit more tricky, I've added some comments related.
In addition, you also have to check the ServerGroupDeploymentReplaceHandler
, which is in charge of /server-group=*:replace-deployment
operation and acepts a runtime-name as an attribute.
@@ -94,6 +95,9 @@ static void validateRuntimeNames(String deploymentName, OperationContext context | |||
Resource root = context.readResourceFromRoot(PathAddress.EMPTY_ADDRESS); | |||
ModelNode domainDeployment = root.getChild(PathElement.pathElement(DEPLOYMENT, deploymentName)).getModel(); | |||
String runtimeName = getRuntimeName(deploymentName, deployment, domainDeployment); | |||
if (!runtimeName.contains(".")) { | |||
DEPLOYMENT_NAMECHECK_LOGGER.deploymentsRuntimeNameWithoutExtension(deploymentName, runtimeName); | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As it is now, this log warning will be invoked twice per each deploy operation. Notice that this method, validateRuntimeNames
, is invoked from two different handlers that are executed together when we deploy in domain mode. The deploy operation in domain mode consists of an add operation followed by a deploy. Here, ServerGroupDeploymentDeployHandler
and ServerGroupDeploymentAddHandler
are both involved during the deployment, and both are calling validateRuntimeNames
.
We have to avoid logging the warning twice. In addition, since this is also dependent on the affected server group, we have to include the server group name as part of the log warn message.
if (!deploymentUnitName.contains(".")) { | ||
DEPLOYMENT_NAMECHECK_LOGGER.deploymentsRuntimeNameWithoutExtension(managementName, deploymentUnitName); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when talking about redeployment, we mean operation deployment-overlay, and it has to do with DomainDeploymentOverlayRedeployLinksHandler, right?
It is not related to the overlay functionality. We are talking here about the redeploy
operation under /server-group=*/deployment=*
resource. The handler is ServerGroupDeploymentRedeployHandler
but according to the code, it seems that the operations there are redirected directly to the managed servers, so I think we are not going to be able to do something easy with it. Being a redeploy that does not change the runtime name, I think we will be ok with it. In addition, the server handler will be already prepared to log the trace in the managed server JVM, so, that's fine with me.
Hello @yersan , |
The Add operation adds the deployment as a server group resource, but the actual deployment on the servers will occur only if you add the resource with
You shouldn't, those approaches tend to be more fragile and complex to cope with all the cases, in addition, we do not keep any memory facility in the operation context, and the handlers should work independently.
Ideally, we have to create an issue describing what you have found with the replace operation, could you do that? it should have a short description and how to reproduce it. WFCORE-6843 is an enhancement, and the one you found is a bug. The bug should be blocking the enhancement, we should fix the bug first, and then add the WFCORE-6843 changes on top of the changes that fix the bug. That can be done in a single PR with two commits, or fix the bug, wait until gets resolved and then continue with WFCORE-6843 |
There has been no activity on this PR for 45 days. It will be auto-closed after 90 days. |
Issue: https://issues.redhat.com/browse/WFCORE-6843