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

[workflows] Postgres deadlock when dealing with parallel nodes failing at the same time #1422

Open
dcoraboeuf opened this issue Feb 20, 2025 · 0 comments

Comments

@dcoraboeuf
Copy link
Contributor

org.springframework.dao.DeadlockLoserDataAccessException: PreparedStatementCallback; SQL [UPDATE WKF_INSTANCES
SET STATUS = ?
WHERE ID = ?]; ERROR: deadlock detected
  Detail: Process 1839684 waits for ShareLock on transaction 129785; blocked by process 1839627.
Process 1839627 waits for ShareLock on transaction 129786; blocked by process 1839684.
  Hint: See server log for query details.
  Where: while updating tuple (20,1) in relation "wkf_instances"; nested exception is org.postgresql.util.PSQLException: ERROR: deadlock detected
  Detail: Process 1839684 waits for ShareLock on transaction 129785; blocked by process 1839627.
Process 1839627 waits for ShareLock on transaction 129786; blocked by process 1839684.
  Hint: See server log for query details.
  Where: while updating tuple (20,1) in relation "wkf_instances"
	at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:268)
	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)
	at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1577)
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:669)
	at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:962)
	at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:983)
	at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.update(NamedParameterJdbcTemplate.java:331)
	at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.update(NamedParameterJdbcTemplate.java:336)
	at net.nemerosa.ontrack.extension.workflows.repository.WorkflowInstanceRepository.instanceStatusUpdate(WorkflowInstanceRepository.kt:155)
	at net.nemerosa.ontrack.extension.workflows.repository.WorkflowInstanceRepository.nodeError(WorkflowInstanceRepository.kt:291)

Scenario: two parallel nodes in a workflow failing at the same time

@dcoraboeuf dcoraboeuf added this to the 4.11 milestone Feb 20, 2025
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