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

Add configuration option to prevent Timers being expunged #8

Open
stuartpullinger opened this issue Apr 26, 2018 · 2 comments
Open
Assignees

Comments

@stuartpullinger
Copy link
Contributor

Glassfish behaves differently to JBoss and Geronimo in expunging timers after an application exception rather than just logging the exception. Expunging the timers in Glassfish can only be fixed by redeploying the application.

We should add the 'reschedule-failed-timer' option to the setup-glassfish.py script to prevent the Timers from being expunged.

Some references:
https://stackoverflow.com/a/18303655
javaee/ejb-spec#111 - requesting clarity in the spec
https://github.com/javaee/glassfish/issues/20749 - reporting issue to Glassfish. Doesn't look like it will be addressed.
https://bitbucket.org/obfischer/glassfish-timerproblem/src - example application to produce the error

@stuartpullinger stuartpullinger self-assigned this Apr 26, 2018
@stuartpullinger stuartpullinger added this to the 4.9.2 milestone May 24, 2018
@stuartpullinger stuartpullinger removed this from the 4.9.2 milestone Jun 28, 2018
@stuartpullinger
Copy link
Contributor Author

Instructions to edit the domain.xml file (found at payara41/glassfish/domains/domain1/config/domain.xml) are here.

I think this would be equivalent to the asadmin command:

asadmin set server.ejb-container.ejb-timer-service.property.reschedule-failed-timer="true"

but I haven't tested it.

@stuartpullinger
Copy link
Contributor Author

The Expunged timers seem to occur when there is a problem with the connection to the database. Database queries hang which leads to scheduled actions failing which leads to the timers being expunged.

One guard against this happening could be to set a timeout for database queries. It can be done in the persistence.xml file and in the code. We currently have Payara version 4.1.2-173 in production which ships with EclipseLink 2.6.4. The reference documentation for setting the timeout in Eclipselink 2.6 is here.

More info (using a more recent version of the spec) is here. The JPA spec states that this new query hint is optional but the documentation for our implementation (EclipseLink) suggest it is supported in version 2.7. The spec states that the value should be milliseconds but the EclipseLink docs say they default to seconds so, if we upgrade Payara and start using the newer javax.persistence.query.timeout hint, care should be taken to also define the eclipselink.jdbc.timeout.unit hint to make clear the units.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant