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

Quartz Scheduler Race Condition #4617

Closed
nathandoef opened this issue Mar 2, 2023 · 0 comments · Fixed by #4607
Closed

Quartz Scheduler Race Condition #4617

nathandoef opened this issue Mar 2, 2023 · 0 comments · Fixed by #4607

Comments

@nathandoef
Copy link
Collaborator

nathandoef commented Mar 2, 2023

Describe the bug
A PSQLException is thrown when jobs are scheduled with a Quartz transactional connector and a Postgres database.

To Reproduce

  1. Configure a Quartz transactional connector with a Postgres datasource
  2. Start hapi-fhir and allow Quartz jobs to be scheduled
  3. See error below:
ERROR: duplicate key value violates unique constraint "qrtz_locks_pkey"
  Detail: Key (sched_name, lock_name)=(cdr-scheduler-cdr-persistence, TRIGGER_ACCESS) already exists.
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2676)
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2366)
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:356)
	at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:496)
	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:413)
	at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:190)
	at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:152)
	at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:1502)
	at org.quartz.impl.jdbcjobstore.StdRowLockSemaphore.executeSQL(StdRowLockSemaphore.java:135)

Expected behavior
Quartz jobs are scheduled with no errors

@nathandoef nathandoef linked a pull request Mar 2, 2023 that will close this issue
@nathandoef nathandoef changed the title Migration Errors When Using Quartz Transactional Connector Quartz Scheduler Race Condition Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant