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

WFLY-17732 - orphaned JDNI binding on deployment failure #16626

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

baranowb
Copy link
Contributor

Issue: https://issues.redhat.com/browse/WFLY-17732

Hold on a merge. This needs investigation, as after rebase, behavior changed when it comes to exported JNDI space.

@github-actions github-actions bot added the deps-ok Dependencies have been checked, and there are no significant changes label Mar 16, 2023
@baranowb
Copy link
Contributor Author

This fails due to difference in how exported name space work in current WFLY?

@rhusar rhusar added the hold PR should not be merged for some reason. label Mar 17, 2023
@rhusar
Copy link
Member

rhusar commented Apr 14, 2023

BTW @baranowb this is still failing on CI.

@baranowb
Copy link
Contributor Author

baranowb commented Apr 27, 2023

Yeah, I saw, no idea why it passed localy... This is just annoying. What is frustrating is that it now pass locally, but I do remember initial failure and another one when I saw this job fail.

@parsharma
Copy link
Contributor

@baranowb could you please check CI is still failing?
Thanks

@soul2zimate soul2zimate added hold PR should not be merged for some reason. and removed hold PR should not be merged for some reason. labels Jul 19, 2023
@baranowb
Copy link
Contributor Author

@parsharma Yeah, Ive seen it. I honestly have no idea, it does not fail locally, nor on anything other than docker image for some reason.

@gaol
Copy link
Contributor

gaol commented Jul 29, 2023

@rhusar PR got updated and CI passed, would you please review ? thanks

@rhusar
Copy link
Member

rhusar commented Aug 1, 2023

@rhusar PR got updated and CI passed, would you please review ? thanks

I am afraid I am not the best person to review this, perhaps @tadamski could review this one? Thanks.

@tadamski
Copy link
Contributor

tadamski commented Aug 3, 2023

I'm not very familiar with naming subsystem. I think this is a question to @emmartins

@gaol gaol requested a review from emmartins August 3, 2023 14:22
@emmartins
Copy link
Contributor

I will review this during this week

@emmartins
Copy link
Contributor

emmartins commented Oct 10, 2023

  • I can't replicate the original issue (JBEAP-23958) with WildFly
  1. deploy app1 (success)
  2. deploy app2 (fails)
  3. undeploy app1 (success)
  4. deploy app2 (success)
  • I see some leftovers on JNDI for app2 after it fails to deploy (those are cleaned after successful app2 redeploy and undeploy tho)

@@ -301,16 +302,44 @@ protected void addJndiBinding(final EEModuleConfiguration module, final BindingC
service = (BinderService) controller.getService();
if (!equals(service.getSource(), bindingConfiguration.getSource())) {
throw EeLogger.ROOT_LOGGER.conflictingBinding(bindingName, bindingConfiguration.getSource());
} else {
Copy link
Contributor

@emmartins emmartins Oct 10, 2023

Choose a reason for hiding this comment

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

no matter not being able to replicate the original issue, and having to re-evaluate the JNDI leftovers after deploy fail, this change is not good, it assumes this is about a bind for same deployment yet this is wrong. There are for instance use cases where the same global JNDI is made by multiple deployments, which we should not fail and (unlike this change) skip the increase of the binding ref counter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

are there any tests for that? if thats a real case, Im fine with ditching this. Nothing fail in TS with his change(AFAIR).

final ServiceController<ManagedReferenceFactory> binderServiceController = controller;
final BinderReleaseService binderReleaseService = new BinderReleaseService(binderServiceController, binderService);
final ServiceBuilder sharedBindingRemovalServiceBuilder = phaseContext.getServiceTarget().addService(phaseContext.getDeploymentUnit().getServiceName().append("sharedBindingReleaseService").append(bindInfo.getBinderServiceName()), binderReleaseService);
sharedBindingRemovalServiceBuilder.addListener(new LifecycleListener() {
Copy link
Contributor

Choose a reason for hiding this comment

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

this may go in the right direction, since the listener will remove the bind ref on REMOVED, not sure yet about the late acquire tho, I have a feeling that long ago we had something like this and had to change to acquire() immediately. Need more investigation...

@baranowb
Copy link
Contributor Author

hmm. indeed something changed in how deployments are handled, thought scanner might have an update: https://issues.redhat.com/browse/WFCORE-6255 but its still not merged. However I can still see leftover bindings:
"applications" => {"app-2.0.0.war" => {
"java:app" => {"AppName" => {
"class-name" => "java.lang.String",
"value" => "app-2.0.0"
}},
"modules" => {"app-2.0.0" => {"java:module" => {
"InAppClientContainer" => {
"class-name" => "java.lang.Boolean",
"value" => "false"
},
"InstanceName" => {
"class-name" => "java.lang.Object",
"value" => "?"
},
"ModuleName" => {
"class-name" => "java.lang.String",
"value" => "app-2.0.0"
},
"Validator" => {
"class-name" => "jakarta.validation.Validator",
"value" => "?"
},
"ValidatorFactory" => {
"class-name" => "org.jboss.as.ee.beanvalidation.LazyValidatorFactory",
"value" => "org.jboss.as.ee.beanvalidation.LazyValidatorFactory@53df3034"
}
}}}
}}
}

with
[standalone@localhost:9990 /] deployment-info
NAME RUNTIME-NAME PERSISTENT ENABLED STATUS
app-2.0.0.war app-2.0.0.war false true FAILED

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 hold PR should not be merged for some reason.
Projects
None yet
7 participants