eclipse-linuxtools / org.eclipse.linuxtools

Eclipse plugins integrating Linux technologies - Docker, SystemTap, Kernel Perf, Valgrind, GGov, GProf, Vagrant, RPM, ...
Eclipse Public License 2.0
12 stars 17 forks source link

New warnings in stderr #335

Closed jonahgraham closed 6 months ago

jonahgraham commented 6 months ago

There are some new warning in Docker tooling usage of Jersey. Presumably related to #314

Feb. 29, 2024 3:45:25 P.M. org.glassfish.jersey.client.innate.inject.NonInjectionManager <init>
WARNING: Falling back to injection-less client.

This comes from a stack like this:

    at org.glassfish.jersey.client.innate.inject.NonInjectionManager.<init>(NonInjectionManager.java:212)
    at org.glassfish.jersey.client.ClientConfig$State.findInjectionManager(ClientConfig.java:484)
    at org.glassfish.jersey.client.ClientConfig$State.initRuntime(ClientConfig.java:419)
    at org.glassfish.jersey.internal.util.collection.Values$LazyValueImpl.get(Values.java:317)
    at org.glassfish.jersey.client.ClientConfig.getRuntime(ClientConfig.java:834)
    at org.glassfish.jersey.client.ClientRequest.getClientRuntime(ClientRequest.java:181)
    at org.glassfish.jersey.client.JerseyWebTarget.onBuilder(JerseyWebTarget.java:371)
    at org.glassfish.jersey.client.JerseyWebTarget.request(JerseyWebTarget.java:214)
    at org.glassfish.jersey.client.JerseyWebTarget.request(JerseyWebTarget.java:38)
    at org.mandas.docker.client.DefaultDockerClient.info(DefaultDockerClient.java:391)
    at org.eclipse.linuxtools.internal.docker.core.DockerConnection.getInfo(DockerConnection.java:433)
    at org.eclipse.linuxtools.internal.docker.core.DockerConnection.setClient(DockerConnection.java:303)
    at org.eclipse.linuxtools.internal.docker.core.DockerConnection.open(DockerConnection.java:272)
    at org.eclipse.linuxtools.internal.docker.core.DefaultTCPConnectionSettingsProvider.getConnectionSettings(DefaultTCPConnectionSettingsProvider.java:32)
    at org.eclipse.linuxtools.internal.docker.core.DefaultDockerConnectionSettingsFinder.getKnownConnectionSettings(DefaultDockerConnectionSettingsFinder.java:210)
    at org.eclipse.linuxtools.docker.core.DockerConnectionManager.lambda$reloadConnections$0(DockerConnectionManager.java:64)
    at java.base/java.lang.Thread.run(Thread.java:833)

Perhaps related to https://github.com/eclipse-linuxtools/org.eclipse.linuxtools/blob/b1971cd993566e0a2765327aefab7696955a2b8d/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerClientFactory.java#L108-L109

jonahgraham commented 6 months ago

One immediate problem I see is that the two threads can be in the call at https://github.com/eclipse-linuxtools/org.eclipse.linuxtools/blob/b1971cd993566e0a2765327aefab7696955a2b8d/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerClientFactory.java#L117 at the same time. This means the second one can restore the setting not back to the original value, but to the value that the first one set it to.

jonahgraham commented 6 months ago

One immediate problem I see

I don't think this causes the OP though.

jonahgraham commented 6 months ago

There is a hidden exception in Jersey:


java.lang.IllegalStateException: InjectionManagerFactory not found.
    at org.glassfish.jersey.internal.inject.Injections.lambda$lookupInjectionManagerFactory$0(Injections.java:86)
    at java.base/java.util.Optional.orElseThrow(Optional.java:403)
    at org.glassfish.jersey.internal.inject.Injections.lookupInjectionManagerFactory(Injections.java:86)
    at org.glassfish.jersey.internal.inject.Injections.createInjectionManager(Injections.java:56)
    at org.glassfish.jersey.client.ClientConfig$State.findInjectionManager(ClientConfig.java:482)
    at org.glassfish.jersey.client.ClientConfig$State.initRuntime(ClientConfig.java:419)
    at org.glassfish.jersey.internal.util.collection.Values$LazyValueImpl.get(Values.java:317)
    at org.glassfish.jersey.client.ClientConfig.getRuntime(ClientConfig.java:834)
    at org.glassfish.jersey.client.ClientRequest.getClientRuntime(ClientRequest.java:181)
    at org.glassfish.jersey.client.JerseyWebTarget.onBuilder(JerseyWebTarget.java:371)
    at org.glassfish.jersey.client.JerseyWebTarget.request(JerseyWebTarget.java:214)
    at org.glassfish.jersey.client.JerseyWebTarget.request(JerseyWebTarget.java:38)
    at org.mandas.docker.client.DefaultDockerClient.info(DefaultDockerClient.java:391)
    at org.eclipse.linuxtools.internal.docker.core.DockerConnection.getInfo(DockerConnection.java:433)
    at org.eclipse.linuxtools.internal.docker.core.DockerConnection.setClient(DockerConnection.java:303)
    at org.eclipse.linuxtools.internal.docker.core.DockerConnection.open(DockerConnection.java:272)
    at org.eclipse.linuxtools.internal.docker.core.DockerConnection.getImages(DockerConnection.java:1062)
    at org.eclipse.linuxtools.internal.docker.core.DockerConnection.getImages(DockerConnection.java:1032)
    at org.eclipse.cdt.docker.launcher.ContainerTargetTypeProvider.init(ContainerTargetTypeProvider.java:85)
    at org.eclipse.launchbar.core.internal.target.LaunchTargetManager.initTargets(LaunchTargetManager.java:123)
    at org.eclipse.launchbar.core.internal.target.LaunchTargetManager.getLaunchTarget(LaunchTargetManager.java:181)
    at org.eclipse.launchbar.core.internal.LaunchBarManager.syncActiveTarget(LaunchBarManager.java:546)
    at org.eclipse.launchbar.core.internal.LaunchBarManager.setActiveLaunchDescriptor(LaunchBarManager.java:502)
    at org.eclipse.launchbar.core.internal.LaunchBarManager.addDescriptor(LaunchBarManager.java:313)
    at org.eclipse.launchbar.core.internal.LaunchBarManager.launchObjectAdded(LaunchBarManager.java:362)
    at org.eclipse.launchbar.core.internal.LaunchBarManager.launchConfigurationAdded(LaunchBarManager.java:916)
    at org.eclipse.launchbar.core.internal.LaunchBarManager.init(LaunchBarManager.java:135)
    at org.eclipse.launchbar.core.internal.LaunchBarManager$1.run(LaunchBarManager.java:100)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

Makes it look like the problem that the TODO in the code has further workarounds needed.

Not sure what I can do here. Perhaps @jjohnstn you have already delved this deep into the problem already?

jjohnstn commented 6 months ago

@jonahgraham No, I haven't seen this, but the switch over is new. I can add synchronization to the property setting/unsetting as that would make sense.

akurtakov commented 6 months ago

https://stackoverflow.com/questions/44088493/jersey-stopped-working-with-injectionmanagerfactory-not-found seems to be on related but I can't figure it out . I would definitely need help on this one as the time frame for 2024-03 is pretty tight. Reverting is not an option as it would make docker tools not work at all with latest docker.

jonahgraham commented 6 months ago

I agree, reverting isn't under consideration.

Other than the (relatively minor) race condition mentioned in https://github.com/eclipse-linuxtools/org.eclipse.linuxtools/issues/335#issuecomment-1971952092 and the warning message itself, I am not convinced there is all that much wrong here.

The normal wiring up mechanism Jersey uses seems to not be working, which my guess means there is some framework issue that needs resolving. But I don't have inclination to learn that framework unless/until there is a more concrete problem identified here.

jonahgraham commented 6 months ago

@jjohnstn well done on tracking down the issue. However I don't think the current fix is sufficient as best as I can tell the new bundle isn't making it to simrel and since I can't see any new dependencies on it. Does it only work in dev environment because it is launched with all plug-ins in workspace&target platform.

I see the org.glassfish.jersey.inject.jersey-hk2_3.1.5.jar bundle here: https://www.eclipse.org/downloads/download.php?file=/linuxtools/updates-docker-nightly/plugins/org.glassfish.jersey.inject.jersey-hk2_3.1.5.jar But not here: https://download.eclipse.org/staging/2024-03

jjohnstn commented 6 months ago

Hi @jonahgraham I added it to the category.xml and it does get added to the Docker Tools repo. I guess I need to add it to docker.core dependencies to force it to be brought in - correct?

jjohnstn commented 6 months ago

@jonahgraham I'll post a new rc2a shortly and get it into simrel

jonahgraham commented 6 months ago

I guess I need to add it to docker.core dependencies to force it to be brought in - correct?

I would agree with that guess.

I'll post a new rc2a shortly and get it into simrel

Brilliant and thank you @jjohnstn

jonahgraham commented 6 months ago

I just tested the EPP build of CPP for 2024-03 RC2 and the warnings on stderr are indeed gone now and a cursory test of the docker integration works. Thanks @jjohnstn