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

Deployment manager/scanner race condition? #12248

Closed
a1730 opened this issue Sep 8, 2024 · 5 comments
Closed

Deployment manager/scanner race condition? #12248

a1730 opened this issue Sep 8, 2024 · 5 comments
Labels

Comments

@a1730
Copy link

a1730 commented Sep 8, 2024

Jetty Version
jetty-12.0.13; built: 2024-09-03T03:04:05.240Z; git: 816018a; jvm 22.0.2+9

Jetty Environment

core,ee8

Java Version
openjdk version "22.0.2" 2024-07-16
OpenJDK Runtime Environment Temurin-22.0.2+9 (build 22.0.2+9)
OpenJDK 64-Bit Server VM Temurin-22.0.2+9 (build 22.0.2+9, mixed mode)

Question
Is there a race between the deploter and scanner in the following, or am I reading it wrong?

2024-09-06 04:29:59.625:INFO :oe.jetty:main: Virtual threads enabled. Using virtual threads for application tasks.
2024-09-06 04:30:00.306:INFO :oejdp.ScanningAppProvider:main: Deployment monitor core in [file:///home/jetty/jetty.base/webapps/] at intervals 0s
2024-09-06 04:30:00.266:INFO :oejs.Server:main: jetty-12.0.13; built: 2024-09-03T03:04:05.240Z; git: 816018a420329c1cacd4116799cda8c8c60a57cd; jvm 22.0.2+9
2024-09-06 04:30:00.326:INFO :oejd.DeploymentManager:main: addApp: App@73194df[core,null,/home/jetty/jetty.base/webapps/root.xml]
=(5)=>2024-09-06 04:30:00.447:WARN :oejdp.ScanningAppProvider:main: class org.eclipse.jetty.deploy.providers.ContextProvider@146587a2[file:///home/jetty/jetty.base/webapps/] no environment for App@5f0e9815[ee8,null,/home/jetty/jetty.base/webapps/joyent.xml], ignoring
2024-09-06 04:30:00.448:INFO :oejdp.ScanningAppProvider:main: Deployment monitor ee8 in [file:///home/jetty/jetty.base/webapps/] at intervals 1s
2024-09-06 04:30:00.451:INFO :oejd.DeploymentManager:main: addApp: App@b1712f3[ee8,null,/home/jetty/jetty.base/webapps/joyent.xml]
2024-09-06 04:30:00.586:INFO :oejs.DefaultSessionIdManager:main: Session workerName=node0

The scanner on line 5 =(5)=> says ee8, there is no environment, ignoring 😢 yet the deployment manager said ee8 on line 7 😄

What are we missing?
Thank you for Jetty.

@a1730 a1730 added the Question label Sep 8, 2024
@joakime
Copy link
Contributor

joakime commented Sep 10, 2024

The App /home/jetty/jetty.base/webapps/joyent.xml had no environment.

That means ...

  • There was no DeploymentManager.getDefaultEnvironmentName() specified.
  • There was no App.getEnvironmentName() specified.
  • There was no /home/jetty/jetty.base/webapps/joyent.properties specified with an environment.

This looks like a custom setup of Jetty, not using the jetty-home/jetty-base.
Or it could be a jetty-base with multiple environments specified, but the webapp XML deployable, or the webapp properties file deployable hasn't picked an environment for that webapp.

@sbordet
Copy link
Contributor

sbordet commented Sep 10, 2024

@joakime I think this is the same issue as #10437.

@a1730 do you confirm that despite the logs, both web applications are deployed correctly?

@janbartel
Copy link
Contributor

janbartel commented Sep 10, 2024

Typed this reply in yesterday but failed to hit send:

This is not an error. There are separate scanners for core and each of the eeX environments, but they're all scanning the same directory. The log message is telling you that the core ContextProvider found the joyent webapp, but it was targeted to a the ee8 environment, so it's ignoring it. Later on you see the ee8 ContextProvider start scanning and it finds and deploys the webapp. Not ideal to have those warnings, but if you really didn't

We already have an issue open to streamline the Deployer a bit: #10437

@a1730
Copy link
Author

a1730 commented Sep 11, 2024

@joakime ,
This is not a custom setup in any way. We only deploy using Jetty sanctioned best practices,

  • Correct, there is no default deployment
  • Does the following answer your questions?
admin:webapps> ls -l
total 6984
-rw-r--r-- 1 admin admin      16 Oct 28  2023 joyent.properties
-rw-r--r-- 1 admin admin 7133347 Jun 24 03:47 joyent.war
-rw-r--r-- 1 admin admin     968 Jun 24 03:51 joyent.xml
-rw-r--r-- 1 admin admin      17 Nov  5  2023 root.properties
-rw-r--r-- 1 admin admin    1440 Nov  5  2023 root.xml

Whereas ROOT leverages jetty core enviroment, joyent is ee8 based.
@sbordet , yes both applications were successfully deployed.
@janbartel , I never implied it was an error. I only reported the issue in case there is a race condition between scanners and deployers.

@sbordet
Copy link
Contributor

sbordet commented Sep 11, 2024

@a1730 thanks for reporting this.

I'm closing this issue as duplicate of #10437.

@sbordet sbordet closed this as completed Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants