News - Informatique

Deadlock

Un interblocage (ou étreinte fatale, deadlock en anglais) est un phénomène qui peut survenir en programmation concurrente. L'interblocage se produit lorsque deux processus concurrents s'attendent mutuellement.

Dans la vie :



Dans les logs :


Code TEXT :
 
2018-09-24 02:06:50,947 [pool-1192-thread-9    ] WARN  org.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: 40P01 
2018-09-24 02:06:50,949 [pool-1192-thread-9    ] ERROR org.hibernate.util.JDBCExceptionReporter - ERROR: deadlock detected 
  Détail : Process 29732 waits for ShareLock on transaction 118224841; blocked by process 8982. 
Process 8982 waits for ShareLock on transaction 118224832; blocked by process 1781. 
Process 1781 waits for ShareLock on transaction 118224839; blocked by process 29732. 
  Indice : See server log for query details. 
        at java.lang.Thread.run(Thread.java:724) 
Caused by: java.util.concurrent.ExecutionException: org.hibernate.exception.GenericJDBCException: could not execute update query 
        at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252) 
        at java.util.concurrent.FutureTask.get(FutureTask.java:111) 
        ... 13 more 
Caused by: org.hibernate.exception.GenericJDBCException: could not execute update query 
        at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140) 
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128) 
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) 
        at org.hibernate.hql.ast.exec.BasicExecutor.execute(BasicExecutor.java:110) 
        at org.hibernate.hql.ast.QueryTranslatorImpl.executeUpdate(QueryTranslatorImpl.java:421) 
        at org.hibernate.engine.query.HQLQueryPlan.performExecuteUpdate(HQLQueryPlan.java:283) 
        at org.hibernate.impl.SessionImpl.executeUpdate(SessionImpl.java:1278) 
        at org.hibernate.impl.QueryImpl.executeUpdate(QueryImpl.java:117) 
        ... 5 more 
Caused by: org.postgresql.util.PSQLException: ERROR: deadlock detected 
  Détail : Process 29732 waits for ShareLock on transaction 118224841; blocked by process 8982. 
Process 8982 waits for ShareLock on transaction 118224832; blocked by process 1781.[/size] 
 


Un batch de plus KO à cause d'un deadlock...