typelevel / typelevel/cats-effect

Figure out how to reduce spurious blocking errors

Open
#3,436 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Scala
Stars
2.2k
Forks
576
Avg merge
2d 11h
Merged PRs (30d)
18

Description

I absolutely love this:

[WARNING] A Cats Effect worker thread was detected to be in a blocked state (WAITING)
  at java.base/jdk.internal.misc.Unsafe.park(Native Method)
  at java.base/java.util.concurrent.locks.LockSupport.park(LockSupport.java:221)
  at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:715)
  at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:938)
  at java.base/java.util.concurrent.locks.ReentrantLock$Sync.lock(ReentrantLock.java:153)
  at java.base/java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:322)
  at java.base/jdk.internal.misc.InternalLock.lock(InternalLock.java:74)
  at java.base/java.io.PrintStream.writeln(PrintStream.java:823)
  at java.base/java.io.PrintStream.println(PrintStream.java:1167)
  at cats.effect.unsafe.WorkerThread.run(WorkerThread.scala:438)

Stare at that for a second and think about what it really means. At least we know the detector is working fairly well!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the warning and stack trace in WorkerThread.scala:438, then trace how the Cats Effect worker-thread blocked-state detector classifies this WAITING state. Determine which legitimate blocking cases are producing spurious warnings, and define a change that reduces those warnings without hiding genuine blocking; the issue is done when the detector's behavior is covered by evidence or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
backend, observability
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.