payara / Payara

Payara Server is an open source middleware platform that supports reliable and secure deployments of Java EE (Jakarta EE) and MicroProfile applications in any environment: on premise, in the cloud or hybrid.
http://www.payara.fish
Other
880 stars 302 forks source link

FISH-9502: adding validation to skip deploy on target #6901

Closed breakponchito closed 2 weeks ago

breakponchito commented 3 weeks ago

Adding validation to skip deploy on target, when not needed

Description

This is to fix a reported issue where an application is deployed on the server instead of only deploy on the instance that was defined from the beginning

Important Info

Blockers

Testing

New tests

Testing Performed

Manual testing by deploying multiple applications on different instances and then stop and restart to validate if only the applications are deployed on the instances and not the server:

Follow the steps described on the ticket, here details: https://payara.atlassian.net/browse/FISH-9502 applications attached here: Reproducers.zip for the steps described on the ticket use the following file: clusterjsp.war

then create other two instances and deploy the following applications:

  1. simpleRest.war
  2. Jakarta10Refresher-1.0-SNAPSHOT.war

At the end you will have the following deployments:

image

then stop the server: asadmin stop-domain

check each application on the specific instances:

instance1: http://localhost:28080/clusterjsp/ image

instance2: http://localhost:28081/simpleRest/test/rest image

instance3: http://localhost:28082/Jakarta10Refresher-1.0-SNAPSHOT/faces/index.xhtml image

then restart server and try to call each application using port 8080, you will see error page, that means applications weren't deployed on the server instance:

image

image

image

and from logs you will see just the loading application message but for the server now those are not initialized

` [#|2024-08-21T21:33:21.578-0600|INFO|Payara 6.2024.9|javax.enterprise.system.core|_ThreadID=45;_ThreadName=RunLevelControllerThread-1724297596011;_TimeMillis=1724297601578;_LevelValue=800;_MessageID=NCLS-CORE-00022;| Loading application clusterjsp done in 2,168 ms|#]

[#|2024-08-21T21:33:21.930-0600|INFO|Payara 6.2024.9|javax.enterprise.system.core|_ThreadID=45;_ThreadName=RunLevelControllerThread-1724297596011;_TimeMillis=1724297601930;_LevelValue=800;| No deployment transformer implementation found.|#]

[#|2024-08-21T21:33:22.017-0600|INFO|Payara 6.2024.9|javax.enterprise.system.core|_ThreadID=45;_ThreadName=RunLevelControllerThread-1724297596011;_TimeMillis=1724297602017;_LevelValue=800;_MessageID=NCLS-CORE-00022;| Loading application simpleRest done in 437 ms|#]

[#|2024-08-21T21:33:22.213-0600|INFO|Payara 6.2024.9|javax.enterprise.system.core|_ThreadID=45;_ThreadName=RunLevelControllerThread-1724297596011;_TimeMillis=1724297602213;_LevelValue=800;| No deployment transformer implementation found.|#]

[#|2024-08-21T21:33:22.317-0600|INFO|Payara 6.2024.9|org.jboss.weld.Version|_ThreadID=45;_ThreadName=RunLevelControllerThread-1724297596011;_TimeMillis=1724297602317;_LevelValue=800;| WELD-000900: 5.0.1 (Final)|#]

[#|2024-08-21T21:33:24.129-0600|INFO|Payara 6.2024.9|fish.payara.micro.cdi.extension.ClusteredCDIEventBusImpl|_ThreadID=45;_ThreadName=RunLevelControllerThread-1724297596011;_TimeMillis=1724297604129;_LevelValue=800;| Clustered CDI Event bus initialized|#]

[#|2024-08-21T21:33:24.141-0600|INFO|Payara 6.2024.9|javax.enterprise.system.core|_ThreadID=45;_ThreadName=RunLevelControllerThread-1724297596011;_TimeMillis=1724297604141;_LevelValue=800;_MessageID=NCLS-CORE-00022;| Loading application Jakarta10Refresher-1.0-SNAPSHOT done in 2,121 ms|#]

[#|2024-08-21T21:33:24.200-0600|INFO|Payara 6.2024.9|javax.enterprise.system.core|_ThreadID=46;_ThreadName=RunLevelControllerThread-1724297596017;_TimeMillis=1724297604200;_LevelValue=800;_MessageID=NCLS-CORE-00101;| Network Listener JMS_PROXY_default_JMS_host started in: 2ms - bound to [/0.0.0.0:7676]|#] `

for testing also review section for modules and components:

image

image

image

include for testing deployment on deployment groups and cluster:

for deployment groups create a new group, add an instance and start, then deploy the application: clusterjsp.war image image test the application on port: 28080 and 8080 image 8080 is not working this is expected behavior: image

stop deployment group and restart server. Again test application o both ports and both will show error: image image

start again the deployment group, test application on port 28080, you will see the application up and running only on port 28080 image

Make the same test for cluster,

create a cluster with one instance and deploy the application: simpleRest.war

image

test application on ports: 28081 and 8080: image

image 8080 is not working this is expected behavior: image

stop cluster and restart server. Again test application o both ports and both will show error: image

image

start again the cluster, test application on port 28081, you will see the application up and running only on port 28081

image

Testing Environment

ubuntu 20.04, azul jdk 11, maven 3.8.6

Documentation

Notes for Reviewers

breakponchito commented 3 weeks ago

Jenkins test please

breakponchito commented 3 weeks ago

Jenkins test please

breakponchito commented 3 weeks ago

Jenkins test please

breakponchito commented 3 weeks ago

issue fixed for Modules and Components entries section

breakponchito commented 3 weeks ago

Jenkins test please

breakponchito commented 3 weeks ago

Jenkins test please

breakponchito commented 3 weeks ago

Jenkins test please

breakponchito commented 3 weeks ago

Jenkins test please

breakponchito commented 3 weeks ago

Jenkins test please

breakponchito commented 2 weeks ago

Jenkins test please

breakponchito commented 2 weeks ago

This seems to break redeployments for deployment groups.

  • Start Payara Server
  • Create a Deployment Group
  • Create an Instance and add it to the deployment group
  • Start the instance
  • Deploy clusterjsp with the Deployment Group as its only target
  • Application gets deployed and is accessible on the instance
  • Restart the instance/deployment group
  • Application doesn't get redeployed.

issue for deployment groups and clusters already fixed