Skip to content

Deadlock in logging #2086

@noonio

Description

@noonio

Context & versions

It seems like there is a deadlock in the logging code.

The error is:

{
    "timestamp":"2025-06-25T12:48:23.289752124Z"
  ,"threadId":7
  ,"namespace":"HydraNode-\"Alice\""
  ,"message":{"node":{"tag":"ReplayingState"},"tag":"Node"}
}
ExceptionInLinkedThread "ThreadId 8" (
    BlockedIndefinitely {
      blockedIndefinitelyCallStack = [
        (
          "wrapBlockedIndefinitely"
        ,SrcLoc {
            srcLocPackage = "io-classes-1.5.0.0-1zdRFRipM5Q9fa4Q4djJxs"
          , srcLocModule = "Control.Monad.Class.MonadSTM.Internal"
          , srcLocFile = "src/Control/Monad/Class/MonadSTM/Internal.hs"
          , srcLocStartLine = 546
          , srcLocStartCol = 16
          , srcLocEndLine = 546
          , srcLocEndCol = 39
        }
      )
      ,(
          "atomically"
        ,SrcLoc {
            srcLocPackage = "hydra-node-0.22.0-6u9maCptbwF22jEywdVuSY"
          , srcLocModule = "Hydra.Logging"
          , srcLocFile = "src/Hydra/Logging.hs"
          , srcLocStartLine = 117
          , srcLocStartCol = 7
          , srcLocEndLine = 117
          , srcLocEndCol = 17
        }
      )
    ]
    , blockedIndefinitelyException = thread blocked indefinitely in an STM transaction
  }
)

This came from adding a link call; see #2084 .

This points to a deadlock here:

Image

Steps to reproduce

  • Unknown ?
  • Seems to occur after processing a lot of transactions

Actual behavior

The hydra-node seems stalled at ReplayingState

Expected behavior

Logging should work fine.

Trivia

See - #2089 - for "repro" steps (not really, but gives an idea of how we saw it go wrong.)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

Status

Done ✔

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions