liveBook · Manning

Cascading blocked thread

As explained in Troubleshooting Java, Second Edition

A cascading blocked thread is a thread whose waiting for an external event causes other threads to wait in sequence rather than forming a circular deadlock.

A cascading blocked thread is a thread waiting for an external event while other threads wait behind it. Unlike a deadlock, the chain does not return to a thread already investigated. section 8.2.1

Investigate the pattern in a thread dump by:

  • Removing threads that are not blocked. section 8.2.1
  • Following lock identifiers through the blocked-thread chain. section 8.2.1
  • Checking whether the chain ends at an external event rather than forming a circular wait. section 8.2.1

Typical external wait

A chain may end with a thread reading from a data source or calling an endpoint, leaving the other threads waiting in sequence. section 8.2.1

Figure 8.10 Cascading locks appear when multiple threads enter a chain where they wait for one another. The last thread in the chain is blocked by an external event, such as reading from a data source or calling an endpoint.

Use the diagram to distinguish a cascading lock chain from a circular deadlock and locate the external event at its end. section 8.2.1

How Troubleshooting Java, Second Edition covers it

How deep it goes
Defines the pattern and gives a thread-dump tracing procedure, but does not prescribe implementation fixes.
Examples
Uses Producer and Consumer threads, data-source reads, and endpoint calls to illustrate blocked chains.
What you can do after
Diagnose/debug with a thread dump by tracing blocked threads and identifying the external event at the chain’s end.
How it connects
Connects thread dumps with deadlocks, locks, and multithreaded architecture.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Troubleshooting Java, Second Edition. The section links point to the parts of the book it draws on.