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

PAYARA-4215: Enable persistent timers in Deployment Group targets #4338

Merged
merged 1 commit into from Nov 21, 2019

Conversation

@pdudits
Copy link
Contributor

pdudits commented Nov 21, 2019

Description

This is a bugfix / feature (bit of both).

Method annotated with @Schedule weren't executed when application was deployed to a deployment group. It was quite correct thing to do, because Deployment Groups are loose groupings of instances that do not necessarily share configuration, inclusive Timer Service configuration.

It is task of DAS to register timers defined by annotations and xml descriptor, and in general it couldn't know which timer service defined in domain to use.

However, from now on we will assume, that user is doing the right thing and his instances' timer service configurations are compatible. E. g. point to same external database, or use DataGrid timer service. At this point, server-config needs to have same timer service configuration as well (separate issue).
DAS will use one of instance's configuration to create the timers.

When such application is deployed a warning is printed on DAS:

[2019-11-20T20:54:53.787+0100] [Payara 5.194] [WARNING] [] [javax.enterprise.system.container.ejb.org.glassfish.ejb.startup] [tid: _ThreadID=57 _ThreadName=admin-thread-pool::admin-listener(1)] [timeMillis: 1574279693787] [levelValue: 900] [[
  Deployment targets deployment group localDG, it is assumed that timer service configuration is consistent accross all members of the group]]

[2019-11-20T20:54:53.836+0100] [Payara 5.194] [INFO] [] [javax.enterprise.system.container.ejb.com.sun.ejb.containers] [tid: _ThreadID=57 _ThreadName=admin-thread-pool::admin-listener(1)] [timeMillis: 1574279693836] [levelValue: 800] [[
  Timer Service configuration local-instance-config will be used to prepare timers]]

Persistent timer will now migrate whenever deployment group member disappears (instance shuts down). Therefore, following are limitations to use persistent timers properly and have them correctly migrate:

  • Timer service config is the same for all instances of deployment group and DAS (same database or DataGrid)
  • DataGrid is enabled and instances see each other
  • Deployment Groups do not form complex topologies. Timers migrate to any instance that is part of any deployment group the parting instance was member of. Any target instance should have same set of (persistence-timer enabled) applications.
  • No application management is done on instance level - disabling application, or undeploying it from instance may break timer migration.

Testing

Testing Performed

Used reproducer from payara-4125.zip.
Create deployment group with multiple instances and deploy the application.
After deployment, all instancess will print 3 messages per second:

  Non-Persistent annotated timer runs
  Non-Persistent Programmatic timer inst1-177f171c-137e-45a4-b3ac-e82efc5f67db runs
  Persistent Programmatic timer inst1 runs

where inst1 is name of instance. One of the instances will also print

  Persistent annotated timer runs

Stopping or killing instances cause persistent timers to migrate to different instance.

Test suites executed

Testing Environment

Zulu JDK 1.8_222 on Windows 10 with Maven 3.6.2

Documentation

T.B.D.

Because there is no shared timer service configuration amongst instances in a
Deployment Group, it is assumed that user configured the instances properly.
Configuration of one of the instances is used to set up annotated timers.
@pdudits pdudits requested review from rdebusscher and jGauravGupta Nov 21, 2019
@pdudits

This comment has been minimized.

Copy link
Contributor Author

pdudits commented Nov 21, 2019

Jenkins test please

Copy link
Contributor

rdebusscher left a comment

Tested this scenario

  • DG with 2 SSH instances
  • Database for EJB persistence store and MySQL
  • Deployment of reproducer with DG as target

Deployment is OK, Timer messages in log of 1 instance and warning messages in the log.

@pdudits pdudits merged commit 8f9ce15 into payara:master Nov 21, 2019
36 of 40 checks passed
36 of 40 checks passed
security/snyk - appserver/core/pom.xml (payara-ci) Test in progress
security/snyk - appserver/flashlight/pom.xml (payara-ci) Test in progress
security/snyk - appserver/load-balancer/pom.xml (payara-ci) Test in progress
security/snyk - nucleus/pom.xml (payara-ci) Test in progress
Payara Quick Build and Test Quick build and test passed!
Details
security/snyk - api/payara-api/pom.xml (payara-ci) No new issues
Details
security/snyk - api/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/appclient/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/batch/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/common/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/connectors/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/deployment/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/distributions/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/ejb/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/extras/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/featuresets/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/grizzly/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/installer/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/jms/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/orb/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/osgi-platforms/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/packager/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/registration/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/security/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/tests/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/transaction/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/web/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/webservices/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/cluster/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/core/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/deployment/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/distributions/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/flashlight/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/grizzly/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/hk2/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/packager/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/resources-l10n/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/resources/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/test-utils/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/tests/pom.xml (payara-ci) No new issues
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.