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-10784 not fail WeldStartCompletionService on optional components #11481

Closed
wants to merge 2 commits into from

Conversation

kudrevatykh
Copy link
Contributor

Thanks for submitting your Pull Request!

Please make sure your PR meets the following requirements:

  • [x ] Pull Request title is properly formatted: [WFLY-XYZ] Subject or WFLY-XYZ Subject
  • [ x] Pull Request contains link to the JIRA issue(s)
  • [ x] Pull Request contains description of the issue(s)
  • [ x] Pull Request does not include fixes for issues other than the main ticket
  • [ x] Attached commits represent units of work and are properly formatted

For bigger changes, major and minor component upgrades make sure your PR also meets following requirements:

  • Pull Request requires a change to the documentation
  • Documentation have been updated accordingly
  • Tests were added to cover changes

For new features ensure as well:

  • Analysis was done
  • Test Plan has been done
  • Tests were verified in advance

If you are not an active contributor of the WildFly project you can request sponsorship by one of the members to help guide you through the process.

Copy link
Contributor

@manovotn manovotn left a comment

Choose a reason for hiding this comment

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

@kudrevatykh first and foremost, I don't understand what is the case where current solution fails (even after reading the JIRA issue). Can you provide a reproducer, detailed description, or, better still, add an automated test?

Secondly, the PR uses deprecated methods from ServiceBuilder which rely on DependencyType and according to javadoc - "Optional dependencies are unsafe and should not be used.". So this isn't a way to go.

We first need to see what's the actual problem and have a way of reproducing it, then we can jump to solutions. That being said, we will likely need to update WeldDeploymentProcessor anyway to remove usage of deprecated classes.

for (DeploymentUnit sub : subDeployments) {
weldStartCompletionServiceBuilder.addDependencies(getComponentStartServiceNames(sub));
getComponentStartServiceNames(sub).entrySet().forEach(e->weldStartCompletionServiceBuilder.addDependencies(e.getKey(), e.getValue()));
Copy link
Contributor

Choose a reason for hiding this comment

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

ServiceBuilder.addDependencies() is deprecated and even says that optional dependencies are unsafe and should not be used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you provide recipe how to depend on component when it can not start in any moment?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know if it is possible at all. With current setup, Weld can do some cleanup operation allowing us to lower the footprint. If we cannot rely on all components started, then we cannot do any cleanup. It also seems that org.jboss.msc.service.ServiceTarget doesn't support your desired approach at all.

Can you please provide a reproducer for your problem (via JIRA - https://issues.jboss.org/browse/WFLY-10784)? If we had that, we could start fiddling with it and see what we can do.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added commit with reproducer, but can't run any test in wildlfy source tree, only in separate project

.add(ConfigurationKey.NON_PORTABLE_MODE.get(), nonPortableMode)
.add(ConfigurationKey.ALLOW_OPTIMIZED_CLEANUP.get(), true)
.build();
.add(ConfigurationKey.NON_PORTABLE_MODE.get(), nonPortableMode)
Copy link
Contributor

Choose a reason for hiding this comment

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

Unnecessary formatting.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@kabir kabir added the fixme label Aug 8, 2018
@kabir
Copy link
Contributor

kabir commented Aug 8, 2018

@kudrevatykh Adding the fixme label until you have addressed @manovotn 's concerns. @mention me once it is all in order

Not fail WeldStartCompletionService when optional components are not started
EJB service and WAR can be deployed when then independent modules, but in EAR can't be deployed
@manovotn
Copy link
Contributor

@kabir please close this PR. I will raise a different one with the approach Brian suggested on JIRA.

@kabir kabir closed this Aug 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants