Skip to content

Integrated Selector: a ready I/O event can go undelivered for seconds while worker threads sit idle #4628

Open

Description

@sideeffffect

We had issues with a service (which happens to use http4s Ember) getting killed by k8s because it became unresponsive. The unresponsiveness includes the liveness check, hence the termination by k8s.
A workaround which seems to have completely eliminate the problem was to

private implicit val network: Network[IO] = Network.forAsync[IO]

when creating the Ember server.
If I understand that correctly, that works around the CE normal way of accepting connections and uses a dedicated thread (pool?) instead.

(edit by djspiewak: the following reproducer was discussed later in the thread and found to not be valid; leaving up for historical context but if you're looking into this bug, this doesn't actually represent the problem)

Here is a reproducer (AI generated 😇 ), which could hopefully lead to a proper fix in the core of the CE runtime.

//> using scala 2.13.14
//> using dep org.typelevel::cats-effect:3.7.0
//> using javaOpt -XX:ActiveProcessorCount=4

/*
 * cats-effect 3.7.0 — a ready I/O event registered on the integrated `Selector` is NOT delivered
 * for as long as its owning worker is not the one that parks-in-poll, EVEN WHILE other worker
 * threads sit idle. Run: `scala-cli run CeLostWakeup.scala` (pins the compute pool to 4 workers).
 *
 * WHY (all in core/jvm-native/src/main/scala/cats/effect/unsafe, v3.7.0):
 *
 *  1. The poller is PER-WORKER: `WorkStealingThreadPool.pollers` holds one `java.nio.Selector`
 *     per worker thread.
 *
 *  2. `SelectorSystem.select(ch, ops)` registers interest via `ctx.accessPoller { poller => ... }`,
 *     and `WorkStealingThreadPool.accessPoller` always runs that callback on the CURRENT worker,
 *     passing THAT worker's own selector (`cb(worker.poller())`). So an interest is always armed on
 *     whichever worker happens to run the registering fiber, and `select` issues NO
 *     `selector.wakeup()`.
 *
 *  3. When a worker runs out of work it decides whether to poll with
 *     `needsPoll = !ownSelector.keys().isEmpty()` (`WorkerThread.scala`), then parks. In
 *     `parkLoop` / `parkLoopUntilNextSleeper` it blocks in `system.poll(selector, ...)` ONLY when
 *     `needsPoll` is true (its OWN selector has registered keys); otherwise it parks via plain
 *     `LockSupport.park()` / `parkNanos(...)` and polls NO selector at all.
 *
 *  => A worker only ever polls its own selector, and any given FD is registered on exactly one
 *     worker's selector. If that worker is not the one that next parks-in-poll (e.g. it is busy, or
 *     an I/O loop's re-arm fiber migrated the interest onto it), the ready FD is serviced by NOBODY:
 *     idle peer workers park "simple" and never poll a selector they don't own. The event waits
 *     until the owning worker itself next polls, or until some worker's `select(nanosUntilNext-
 *     Sleeper)` times out at the next scheduled timer — seconds later, with CPU idle.
 *
 * This program arms MANY OP_READ interests on separate pipes, each on its OWN fiber, so the
 * interests get spread across EVERY worker's selector. It then occupies all-but-one worker with
 * non-yielding work and makes all the FDs ready at once from a non-cats-effect thread. Every
 * readiness callback should fire in microseconds; instead only the interests that happened to be
 * armed on the single still-idle worker's selector are delivered promptly — the rest, armed on the
 * busy workers' selectors, are stranded ~the full hold while at least one core sits idle. Because
 * the interests are spread over all workers, many are stranded on EVERY run (no reliance on a
 * single lucky/unlucky placement). A thread dump taken while the events are pending shows the busy
 * workers RUNNABLE — none of them polling the selectors on which the stranded FDs are registered —
 * while the lone idle worker polls ONLY its own selector (and so delivers just its share). A worker
 * with no keys of its own would instead park "simple" in `LockSupport.park`, polling nothing at
 * all. Either way the stranded FDs sit on the busy workers' selectors, serviced by nobody.
 * Switching fs2-io/NIO from the integrated `Selector` to a NIO2 `AsynchronousChannelGroup` (whose
 * dedicated I/O thread delivers completions) avoids this entirely.
 */

import cats.effect._
import cats.syntax.all._
import java.nio.ByteBuffer
import java.nio.channels.Pipe
import java.nio.channels.SelectionKey.OP_READ
import scala.concurrent.duration._
import scala.jdk.CollectionConverters._

object CeLostWakeup extends IOApp.Simple {

  private val Workers    = Runtime.getRuntime.availableProcessors // = 4 (pinned via javaOpt above)
  private val HoldMillis  = 2000L                                  // how long all-but-one worker is occupied
  private val Interests   = Workers * 8                            // arm many, so every worker's selector gets some
  private val Trials      = 6

  // A non-cats-effect thread that runs an action on request (so "becomes ready" is genuinely external).
  private final class External {
    private val q = new java.util.concurrent.SynchronousQueue[Runnable]
    private val t = new Thread(() => while (true) q.take().run(), "external-io"); t.setDaemon(true); t.start()
    def run(action: => Unit): Unit = q.put(() => action)
  }

  // One-shot dump: print the compute workers' states while the events are still pending.
  private def dumpWorkers(): Unit = {
    val sb = new StringBuilder("    [thread dump while the ready events are pending]\n")
    Thread.getAllStackTraces.asScala.toSeq.filter(_._1.getName.contains("io-compute")).sortBy(_._1.getName).foreach {
      case (th, st) =>
        val top      = st.take(6).map(_.toString)
        val inEpoll  = top.exists(s => s.contains("EPoll") || s.contains("SelectorImpl"))
        val parkSimp = !inEpoll && top.exists(_.contains("LockSupport.park"))
        val tag      = if (inEpoll) " <EPOLL: polling its own selector>" else if (parkSimp) " <PARK-SIMPLE: polling NOTHING>" else ""
        sb.append(s"      ${th.getName} [${th.getState}]$tag\n")
    }
    System.out.println(sb.toString)
  }

  def run: IO[Unit] = Selector.get.flatMap { selector =>
    val external = new External

    val openPipe = IO {
      val p = selector.provider.openPipe()
      p.source.configureBlocking(false); p.sink.configureBlocking(false); p
    }

    def oneTrial(i: Int): IO[Unit] =
      Resource.make(openPipe)(p => IO { p.sink.close(); p.source.close() }).replicateA(Interests).use { pipes =>
        val spin = IO { val end = System.nanoTime() + HoldMillis * 1000000L; while (System.nanoTime() < end) {} }
        for {
          // (a) Arm OP_READ on each pipe, EACH ON ITS OWN FIBER, so the interests spread across every
          //     worker's selector. Each fiber records the moment its own event is delivered.
          armed   <- pipes.traverse(p => (selector.select(p.source, OP_READ) *> IO(System.nanoTime())).start)
          _       <- IO.sleep(100.millis) // let (a) finish registering and spreading across the selectors
          // (b) Occupy all-but-one worker with non-yielding work, so most workers can neither park-
          //     in-poll nor steal — but at least one worker stays idle and parks "simple".
          spins   <- List.fill(Workers - 1)(spin).traverse(_.start)
          // (c) Make EVERY FD ready from the external thread, and snapshot a dump ~600ms later while
          //     the events are (provably) still pending and a core is idle.
          firedAt <- IO {
                       external.run {
                         pipes.foreach(_.sink.write(ByteBuffer.wrap(Array[Byte](1))))
                         if (i == 0) { Thread.sleep(600); dumpWorkers() }
                       }
                       System.nanoTime()
                     }
          _           <- spins.traverse_(_.joinWithNever)
          deliveredAt <- armed.traverse(_.joinWithNever)
          _           <- pipes.traverse_(p => IO(p.source.read(ByteBuffer.allocate(8))))
          latencies    = deliveredAt.map(d => (d - firedAt) / 1000000.0)
          stranded     = latencies.count(_ > 100)
          fast         = latencies.size - stranded
          // NB: `fast` are the interests that happened to be armed on the one worker left free to
          // poll; `stranded` landed on a held worker and waited ~the whole hold, with a core idle.
          _           <- IO.println(
                           f"trial $i: $Interests interests -> fast=$fast stranded=$stranded   " +
                           f"(min=${latencies.min}%.1f ms, max=${latencies.max}%.1f ms)" +
                           (if (stranded > 0) "   <-- STRANDED (no CPU needed to deliver them; a core was idle)" else ""))
        } yield ()
      }

    IO.println(
      s"workers=$Workers, arming $Interests interests, holding ${Workers - 1} of them busy for ${HoldMillis}ms per trial\n") *>
      (0 until Trials).toList.traverse_(oneTrial) *>
      IO.println(
        "\nExpected on a healthy runtime: every interest ~<1 ms. Observed: the majority ~the hold time, with a core idle.")
  }
}

Activity

  1. djspiewak commented on Jun 29, 2026

    @djspiewak
    Member

    This is a symptom of starvation. If you have large chunks of non-yielding work, those worker threads will not be able to do anything else. Starvation pathologies are somewhat mitigated in the pure-compute case by work stealing, and similarly in the timer case, but we don't at present support a general mechanism for stealing event registration.

    More generally, Cats Effect's scheduler takes the prescription that starvation mitigation is always best effort, since there's simply no way to mitigate it in all cases: if you have long-duration thread blockage or other non-yielding tasks, the system will almost always degrade rapidly. So in other words, we try to help this case be a bit more graceful, but at the end of the day, you're just using the system in unsupported ways.

    Do you genuinely have extremely large-granularity non-yielding tasks as in the reproducer? Or was that simply AI just reaching for any way to reproduce the issue?

  2. sideeffffect commented on Jun 30, 2026

    @sideeffffect
    Author

    Do you genuinely have extremely large-granularity non-yielding tasks as in the reproducer?

    No, we don't have large non-yielding tasks.
    The spin loop in the reproducer was an AI device to force the mechanism, not a model of our workload. Sorry for the red herring. The heaviest synchronous step in the service is a ~ms RSA sign on token mint, and our thread dumps show it isn't even running when the freeze hits.

    The service is a plain http4s-Ember server on cats-effect 3.6.3 3.7.0 (default integrated Network). We caught a clean mid-stall thread dump during a real liveness freeze (fired by a watchdog while the stall was in progress, before any SIGTERM). At that instant:

    • all 4 WSTP workers are parked in SelectorSystem.poll → WorkerThread.parkLoopUntilNextSleeper → EPoll.wait (idle, ~0.12 of 4 cores), no business/RSA frames;
    • a fresh connection to a static endpoint (/meta/healthy, just returns "ok") connects but gets no response — Read timed out — for ~20s, until the pod is killed; established/keep-alive traffic is unaffected.

    So a ready OP_ACCEPT (and the static handler that would follow) isn't delivered while the pool sits idle in the poller. It's rare (~1/pod-day) and we could not minimally reproduce it 😿 . We did rule out two obvious candidates: the cross-thread interestOps-while-another-worker-is-in-select() race (self-heals, since accessPoller registers on the running worker), and IO.blocking worker-detach orphaning a selector (the poller follows the worker index to the replacement).

    Switching the server to Network.forAsync (NIO2) eliminates it entirely.

    Does an idle-pool stranded accept ring any bells? Somewhere the accept-loop's readiness/re-arm could be lost while workers are polling?

  3. djspiewak commented on Jun 30, 2026

    @djspiewak
    Member

    That sounds a lot more like a proper bug. I wonder if there's some race condition here where selector registration can get lost, either in the polling system or in Network? Do you have an easy way to try CE 3.7?

  4. sideeffffect commented on Jul 1, 2026

    @sideeffffect
    Author

    Hello Daniel, let me apologize for the misinformation. On a second look, I realized we've been running on Cats Effect 3.7.0 for a long time already. That means these freezes (causing k8s terminating the pod) have been happening on 3.7. And, for what it's worth, the workaround with Network.forAsync[IO] did the job on that version.

  5. djspiewak commented on Jul 1, 2026

    @djspiewak
    Member

    Okay excellent. Well as I said, this sounds like a fairly rare race condition in selector registration. We need to hunt it down but if you're able to get any other form of minimization it would definitely help.

  6. sideeffffect commented on Jul 3, 2026

    @sideeffffect
    Author

    Would this (AI generated) reproducer be helpful to you?

    Run: MODE=selector scala-cli run SelectorReflect.scala --java-opt -XX:ActiveProcessorCount=4 (pin 4 workers). AIO control: MODE=aio ….

    # integrated selector (reproduces the strand):
    MODE=selector DUR_S=480 scala-cli run SelectorReflect.scala --java-opt -XX:ActiveProcessorCount=4
    
    # AIO control (should show 0 strands):
    MODE=aio DUR_S=120 scala-cli run SelectorReflect.scala --java-opt -XX:ActiveProcessorCount=4

    What it is: not a hang — the pool stays healthy (max fresh-connection probe ~23–57ms). It's a reflective detector: a raw OS thread snapshots each worker-selector and flags a SelectionKey whose interest is READY while the owning worker is idle-parked (not in that selector's select) and no worker is in epoll.

    Result: over ~8 min / ~3.6M accepts on the integrated selector it flagged 5–6 DEFINITE-READY strands (ready OP_ACCEPT on a parked owner); on Network.forAsync under identical load: 0.

    //> using scala 2.13.14
    //> using dep org.typelevel::cats-effect:3.7.0
    //> using dep co.fs2::fs2-io:3.13.0
    
    /*
     * SRE-197 selector-registration-race hunter with DIRECT REFLECTIVE INSTRUMENTATION.
     *
     * This is NOT the forced-divergence latency harness (that one used non-yielding CPU spins
     * to occupy workers; refuted as the *spontaneous* mechanism). This harness:
     *
     *   (1) reflects into CE 3.7.0 internals from a RAW OS watchdog thread (not a CE fiber, so
     *       it keeps working even if the WSTP is stuck):
     *         IORuntime.compute -> WorkStealingThreadPool
     *           .pollers : Array[SelectorSystem$Poller]   (each wraps a java.nio.Selector)
     *           .workerThreads : AtomicReferenceArray[WorkerThread]  (poller i <-> worker i)
     *       For each poller's Selector every ~POLL_MS AND on any slow probe, it snapshots:
     *         selector.keys() -> per SelectionKey: interestOps, readyOps, isValid, channel kind
     *         owning worker thread: java Thread.State + whether its top frame is in EPoll.wait
     *         (i.e. actually blocked in THIS selector's select) vs park-simple / runnable.
     *
     *   (2) DETECTS THE BUG DIRECTLY, without waiting for a multi-second symptom. A key is
     *       flagged STRANDED at the instant:
     *         (a) it has a live interest (interestOps & (OP_ACCEPT|OP_READ|OP_CONNECT|OP_WRITE) != 0)
     *             AND its owning worker is NOT currently blocked in that selector's select
     *             (readiness therefore cannot wake anyone) AND no other worker is in an epoll that
     *             could service it -> classic "armed interest on a non-polling selector"; or
     *         (b) readyOps shows the interest is READY but the selectedKey has not been drained
     *             within STRAND_MS (callback didn't fire); or
     *         (c) OP_ACCEPT is armed on NO selector at all while the accept loop should be live.
     *       Any flagged snapshot (even transient) is logged in full: this is the artifact.
     *
     *   (3) NO artificial non-yielding spins anywhere. Migration pressure is created purely by a
     *       flood of short COOPERATIVE (yielding) fibers, so the accept re-arm continuation
     *       bounces across workers via work-stealing on nearly every accept.
     *
     * Load: an in-process raw-OS-thread driver opens millions of fresh short-lived connections
     * plus synchronized bursts against a real fs2 Network[IO] echo accept loop. A shared fs2
     * client does constant outbound calls to a local stub (cross-worker connection-FD churn).
     * A few IO.blocking loops model kafka-poll. Many persistent registered sockets spread keys
     * across all 4 selectors.
     *
     * MODE=selector (default, Network[IO] = forIO integrated selector) | aio (Network.forAsync).
     *
     * Env levers:
     *   MODE           selector | aio                    (default selector)
     *   DUR_S          run seconds                        (default 600)
     *   POLL_MS        watchdog snapshot period ms        (default 100)
     *   PROBE_MS       fresh-connection probe period ms   (default 50)
     *   PROBE_SLOW_MS  probe latency that triggers a snapshot (default 200)
     *   STRAND_MS      ready-but-undrained threshold ms   (default 40)
     *   MIGRATORS      # cooperative yielding fibers      (default 20000)
     *   KEEPALIVE      persistent registered sockets      (default 400)
     *   BLOCKERS       IO.blocking kafka-like loops        (default 4)
     *   CLIENTS        outbound client call fibers         (default 32)
     *   DRIVERS        raw-OS connection-flood threads     (default 16)
     *   BURST          extra conns per synchronized burst  (default 2000)
     *   BURST_MS       burst period ms                     (default 500)
     */
    
    import cats.effect._
    import cats.effect.unsafe.IORuntime
    import cats.effect.std.Random
    import cats.syntax.all._
    import com.comcast.ip4s._
    import fs2.io.net.{Network, Socket}
    import fs2.Stream
    
    import scala.concurrent.duration._
    import scala.jdk.CollectionConverters._
    import java.lang.reflect.Method
    import java.nio.channels.{Selector, SelectionKey, ServerSocketChannel, SocketChannel}
    import java.nio.channels.SelectionKey._
    import java.util.concurrent.atomic.{AtomicLong, AtomicBoolean, AtomicReference}
    
    object SelectorReflect extends IOApp.Simple {
    
      def env(k: String, d: String): String = Option(System.getenv(k)).getOrElse(d)
      val mode        = env("MODE", "selector")
      val durS        = env("DUR_S", "600").toInt
      val pollMs      = env("POLL_MS", "100").toLong
      val probeMs     = env("PROBE_MS", "50").toLong
      val probeSlowMs = env("PROBE_SLOW_MS", "200").toLong
      val strandMs    = env("STRAND_MS", "40").toLong
      val migrators   = env("MIGRATORS", "20000").toInt
      val keepalive   = env("KEEPALIVE", "400").toInt
      val blockers    = env("BLOCKERS", "4").toInt
      val clients     = env("CLIENTS", "32").toInt
      val drivers     = env("DRIVERS", "16").toInt
      val burst       = env("BURST", "2000").toInt
      val burstMs     = env("BURST_MS", "500").toLong
    
      val serverPort = 9199
      val stubPort   = 9198
    
      // ---------- counters ----------
      val totalAccepts = new AtomicLong(0)
      val totalProbes  = new AtomicLong(0)
      val slowProbes   = new AtomicLong(0)
      val maxProbeMs   = new AtomicLong(0)
      val flagCount    = new AtomicLong(0)
      val running      = new AtomicBoolean(true)
      @volatile var rt: IORuntime = _
    
      // probe latency histogram buckets (ms): <1,<2,<5,<10,<20,<50,<100,<200,<500,<1000,>=1000
      val hist = Array.fill(11)(new AtomicLong(0))
      def bucket(ms: Long): Int =
        if (ms < 1) 0 else if (ms < 2) 1 else if (ms < 5) 2 else if (ms < 10) 3
        else if (ms < 20) 4 else if (ms < 50) 5 else if (ms < 100) 6 else if (ms < 200) 7
        else if (ms < 500) 8 else if (ms < 1000) 9 else 10
      val histLabels = Array("<1","<2","<5","<10","<20","<50","<100","<200","<500","<1000",">=1000")
    
      // ===================================================================================
      // REFLECTION into CE internals. Resolved lazily once the runtime exists.
      // ===================================================================================
      object Reflect {
        @volatile var ok = false
        @volatile var reason = "uninit"
        private var pool: AnyRef = _
        private var pollersArr: Array[AnyRef] = _        // Array[SelectorSystem$Poller]
        private var mGetWorker: Method = _               // WSTP.getWorkerThread(int)
        private var mSelector: Method = _                // Poller.<mangled>$selector() -> AbstractSelector
        private var mOutstanding: Method = _             // Poller.operationsOutstandingCount()
        private var mAcceptOut: Method = _               // Poller.acceptOperationsOutstandingCount()
    
        def init(runtime: IORuntime): Unit = try {
          val compute = runtime.compute // ExecutionContext; the WSTP itself
          pool = compute.asInstanceOf[AnyRef]
          val poolCls = pool.getClass
          val mPollers = poolCls.getMethod("pollers"); mPollers.setAccessible(true)
          pollersArr = mPollers.invoke(pool).asInstanceOf[Array[AnyRef]]
          mGetWorker = poolCls.getMethod("getWorkerThread", classOf[Int]); mGetWorker.setAccessible(true)
          val pc = pollersArr(0).getClass
          mSelector = pc.getMethod("cats$effect$unsafe$SelectorSystem$$selector"); mSelector.setAccessible(true)
          mOutstanding = pc.getMethod("operationsOutstandingCount"); mOutstanding.setAccessible(true)
          mAcceptOut = pc.getMethod("acceptOperationsOutstandingCount"); mAcceptOut.setAccessible(true)
          ok = true
          reason = s"ok: pool=${poolCls.getName} pollers=${pollersArr.length} pollerCls=${pc.getName}"
        } catch { case t: Throwable => ok = false; reason = s"reflect-init-failed: ${t}" }
    
        def pollerCount: Int = if (pollersArr == null) 0 else pollersArr.length
    
        def selectorOf(i: Int): Selector =
          mSelector.invoke(pollersArr(i)).asInstanceOf[Selector]
    
        def outstandingOf(i: Int): Int =
          try mOutstanding.invoke(pollersArr(i)).asInstanceOf[Integer].intValue catch { case _: Throwable => -1 }
    
        def acceptOutstandingOf(i: Int): Int =
          try mAcceptOut.invoke(pollersArr(i)).asInstanceOf[Integer].intValue catch { case _: Throwable => -1 }
    
        def workerOf(i: Int): Thread =
          try mGetWorker.invoke(pool, Integer.valueOf(i)).asInstanceOf[Thread]
          catch { case _: Throwable => null }
      }
    
      // ---------- snapshot model ----------
      final case class KeyInfo(interest: Int, ready: Int, valid: Boolean, chKind: String)
      final case class SelInfo(idx: Int, keys: List[KeyInfo], workerState: String,
                               inThisEpoll: Boolean, workerName: String, topFrames: List[String],
                               outstanding: Int, acceptOutstanding: Int)
      final case class Snapshot(t: Long, sels: List[SelInfo])
    
      def opsStr(o: Int): String = {
        val b = new StringBuilder
        if ((o & OP_ACCEPT) != 0) b.append("A")
        if ((o & OP_CONNECT) != 0) b.append("C")
        if ((o & OP_READ) != 0) b.append("R")
        if ((o & OP_WRITE) != 0) b.append("W")
        if (b.isEmpty) "-" else b.toString
      }
      val LIVE = OP_ACCEPT | OP_READ | OP_CONNECT | OP_WRITE
    
      // Is this worker thread currently blocked inside a Selector.select (epoll_wait)?
      def framesOf(t: Thread): List[String] =
        if (t == null) Nil
        else t.getStackTrace.take(6).map(f => s"${f.getClassName}.${f.getMethodName}").toList
      def inEpoll(frames: List[String]): Boolean =
        frames.exists(f => f.contains("EPoll.wait") || f.contains("EPollSelectorImpl.doSelect") ||
                           f.contains("SelectorImpl.lockAndDoSelect") || f.endsWith("Net.poll"))
    
      def snapshot(): Snapshot = {
        val n = Reflect.pollerCount
        val sels = (0 until n).toList.flatMap { i =>
          try {
            val sel = Reflect.selectorOf(i)
            val w = Reflect.workerOf(i)
            val frames = framesOf(w)
            val keys = sel.keys().asScala.toList.map { k =>
              val (interest, valid) =
                try (k.interestOps(), true) catch { case _: Throwable => (0, false) }
              val ready = try k.readyOps() catch { case _: Throwable => 0 }
              val kind = k.channel() match {
                case _: ServerSocketChannel => "LISTEN"
                case _: SocketChannel       => "SOCK"
                case other                  => other.getClass.getSimpleName
              }
              KeyInfo(interest, ready, valid, kind)
            }
            Some(SelInfo(i, keys,
              if (w == null) "?" else w.getState.toString,
              inEpoll(frames),
              if (w == null) s"poller-$i" else w.getName, frames,
              Reflect.outstandingOf(i), Reflect.acceptOutstandingOf(i)))
          } catch { case _: Throwable => None }
        }
        Snapshot(System.nanoTime(), sels)
      }
    
      // Is a worker IDLE (parked-simple: WAITING/TIMED_WAITING in LockSupport.park, NOT in epoll)?
      // This is the prod stall signature: the interest-owning core is asleep, not busy.
      def isIdleParked(si: SelInfo): Boolean = {
        val st = si.workerState
        val parked = si.topFrames.exists(f => f.contains("LockSupport.park") || f.contains("Unsafe.park"))
        (st == "WAITING" || st == "TIMED_WAITING") && parked && !si.inThisEpoll
      }
    
      // Direct stranding detection. Returns (candidateFlags, definiteStrandFlags).
      //  - candidate = live interest on a selector whose owner is idle-parked (prod signature),
      //    but this may still be a sub-millisecond hand-off; caller confirms via persistence.
      //  - definite  = the interest is *ready* (ready & interest overlap) yet undrained while the
      //    owner is idle-parked -> readiness observed and provably not being serviced. This is the
      //    lost-registration artifact and does not require persistence to be meaningful.
      def detect(s: Snapshot): (List[String], List[String]) = {
        val cand = scala.collection.mutable.ListBuffer.empty[String]
        val definite = scala.collection.mutable.ListBuffer.empty[String]
        val anyEpoll = s.sels.exists(_.inThisEpoll)
        s.sels.foreach { si =>
          val idle = isIdleParked(si)
          si.keys.foreach { k =>
            val live = (k.interest & LIVE) != 0 && k.valid
            val readyForInterest = (k.ready & k.interest & LIVE) != 0
            if (live && idle) {
              // owner is asleep; readiness on THIS key can never wake it (no wakeup() on register)
              if (readyForInterest)
                definite += s"STRAND-READY: sel#${si.idx} ${k.chKind} interest=${opsStr(k.interest)} " +
                  s"READY=${opsStr(k.ready & k.interest)} owner=${si.workerName}/${si.workerState} " +
                  s"parked-idle=true anyWorkerInEpoll=$anyEpoll outstandingOps=${si.outstanding}"
              else
                cand += s"STRAND-ARMED-IDLE: sel#${si.idx} ${k.chKind} interest=${opsStr(k.interest)} " +
                  s"ready=${opsStr(k.ready)} owner=${si.workerName}/${si.workerState} parked-idle=true " +
                  s"anyWorkerInEpoll=$anyEpoll outstandingOps=${si.outstanding}"
            }
          }
        }
        (cand.toList, definite.toList)
      }
    
      def renderSnapshot(s: Snapshot, tag: String): String = {
        val sb = new StringBuilder
        sb.append(s"\n===== SELECTOR SNAPSHOT ($tag) t=${s.t} =====\n")
        val inEp = s.sels.count(_.inThisEpoll)
        sb.append(s"pollers=${s.sels.size} workersInEpoll=$inEp\n")
        s.sels.foreach { si =>
          sb.append(f"-- sel#${si.idx} owner=${si.workerName} state=${si.workerState} inThisEpoll=${si.inThisEpoll} keys=${si.keys.size} outstandingOps=${si.outstanding} acceptOutstanding=${si.acceptOutstanding}\n")
          // summarize keys by kind+interest to avoid megabytes when KEEPALIVE is huge
          val grouped = si.keys.groupBy(k => (k.chKind, opsStr(k.interest), opsStr(k.ready), k.valid))
          grouped.toList.sortBy(-_._2.size).take(12).foreach { case ((kind, ints, rdy, valid), ks) =>
            sb.append(f"     ${ks.size}%5d x $kind interest=$ints ready=$rdy valid=$valid\n")
          }
          if (si.inThisEpoll == false && si.keys.nonEmpty)
            sb.append(s"     TOPFRAMES: ${si.topFrames.mkString(" <- ")}\n")
        }
        sb.toString
      }
    
      // ===================================================================================
      // WATCHDOG raw OS thread: periodic snapshot + detection + slow-probe-triggered snapshot.
      // ===================================================================================
      val lastFlagged = new AtomicReference[String]("")
      val candCount   = new AtomicLong(0)   // transient armed-idle candidates seen
      val defCount    = new AtomicLong(0)   // definite READY-on-idle strands
      val persistCount= new AtomicLong(0)   // candidates confirmed persistent across >=2 polls
    
      // Extract the per-key strand identity so we can test persistence across consecutive polls.
      def strandKeys(s: Snapshot): Set[String] =
        s.sels.filter(isIdleParked).flatMap { si =>
          si.keys.collect { case k if (k.interest & LIVE) != 0 && k.valid => s"${si.idx}:${k.chKind}:${opsStr(k.interest)}" }
        }.toSet
    
      def startWatchdog(): Thread = {
        val t = new Thread(() => {
          var tries = 0
          while (running.get() && !Reflect.ok && tries < 200) { Thread.sleep(50); tries += 1 }
          if (!Reflect.ok) System.out.println(s"[watchdog] reflection not ready: ${Reflect.reason}")
          else System.out.println(s"[watchdog] ${Reflect.reason}")
          var prevStrand: Set[String] = Set.empty
          while (running.get() && Reflect.ok) {
            try {
              val s = snapshot()
              val (cand, definite) = detect(s)
              // (1) definite READY-on-idle: readiness observed, owner asleep, unserviceable. Log always.
              if (definite.nonEmpty) {
                defCount.incrementAndGet(); flagCount.incrementAndGet()
                val out = new StringBuilder
                out.append(s"\n########## DEFINITE STRAND (READY on idle-parked worker) #${defCount.get()} ##########\n")
                definite.foreach(f => out.append("  !! " + f + "\n"))
                out.append(renderSnapshot(s, s"definite=${definite.size}"))
                val msg = out.toString; lastFlagged.set(msg); System.out.println(msg)
              }
              // (2) armed-idle candidate: confirm persistence across consecutive polls.
              if (cand.nonEmpty) {
                candCount.incrementAndGet()
                val nowStrand = strandKeys(s)
                val persisted = nowStrand.intersect(prevStrand)
                if (persisted.nonEmpty) {
                  persistCount.incrementAndGet(); flagCount.incrementAndGet()
                  val out = new StringBuilder
                  out.append(s"\n########## PERSISTENT ARMED-IDLE STRAND #${persistCount.get()} (survived >=2 polls) ##########\n")
                  out.append("  persisted keys: " + persisted.mkString(", ") + "\n")
                  cand.foreach(f => out.append("  ! " + f + "\n"))
                  out.append(renderSnapshot(s, s"persistent"))
                  val msg = out.toString; lastFlagged.set(msg); System.out.println(msg)
                }
                prevStrand = nowStrand
              } else prevStrand = Set.empty
            } catch { case t: Throwable => }
            Thread.sleep(pollMs)
          }
        }, "sel-watchdog")
        t.setDaemon(true); t.start(); t
      }
    
      // Fresh-connection prober from a raw OS thread. On slow probe, force an immediate snapshot.
      def startProber(): Thread = {
        val t = new Thread(() => {
          while (running.get() && !Reflect.ok) Thread.sleep(50)
          while (running.get()) {
            val t0 = System.nanoTime()
            var okConn = false
            try {
              val ch = SocketChannel.open()
              ch.socket().setSoTimeout(15000)
              ch.socket().connect(new java.net.InetSocketAddress("127.0.0.1", serverPort), 15000)
              val out = ch.socket().getOutputStream
              out.write("p".getBytes); out.flush()
              val in = ch.socket().getInputStream
              val b = in.read() // echo byte
              okConn = b >= 0
              ch.close()
            } catch { case _: Throwable => }
            val ms = (System.nanoTime() - t0) / 1000000L
            totalProbes.incrementAndGet()
            hist(bucket(ms)).incrementAndGet()
            var cm = maxProbeMs.get(); while (ms > cm && !maxProbeMs.compareAndSet(cm, ms)) cm = maxProbeMs.get()
            if (ms >= probeSlowMs) {
              slowProbes.incrementAndGet()
              // Take several fast back-to-back snapshots to catch the state DURING the slow window.
              val snaps = (0 until 5).map { _ => val sn = snapshot(); Thread.sleep(3); sn }
              val flagged = snaps.map(sn => (sn, detect(sn))).filter { case (_, (c, d)) => c.nonEmpty || d.nonEmpty }
              System.out.println(s"\n@@@ SLOW PROBE ${ms}ms (conn=$okConn) -> ${snaps.size} snapshots; flaggedSnaps=${flagged.size} @@@")
              flagged.headOption.foreach { case (sn, (c, d)) =>
                (d ++ c).foreach(f => System.out.println("  ! " + f))
                System.out.println(renderSnapshot(sn, s"slowprobe-${ms}ms"))
              }
              if (flagged.isEmpty) System.out.println(renderSnapshot(snaps.last, s"slowprobe-${ms}ms-noflag"))
            }
            Thread.sleep(probeMs)
          }
        }, "sel-prober")
        t.setDaemon(true); t.start(); t
      }
    
      // Raw OS connection-flood driver threads (external, not on WSTP).
      def startDrivers(): List[Thread] = (0 until drivers).toList.map { id =>
        val t = new Thread(() => {
          while (running.get() && !Reflect.ok) Thread.sleep(20)
          val addr = new java.net.InetSocketAddress("127.0.0.1", serverPort)
          while (running.get()) {
            try {
              val ch = SocketChannel.open()
              ch.connect(addr)
              val out = ch.socket().getOutputStream
              out.write('x'); out.flush()
              ch.socket().getInputStream.read()
              ch.close()
              totalAccepts.incrementAndGet()
            } catch { case _: Throwable => Thread.sleep(1) }
          }
        }, s"flood-$id")
        t.setDaemon(true); t.start(); t
      }
    
      // Synchronized burst driver: every burstMs, fire `burst` connections as fast as possible.
      def startBurster(): Thread = {
        val t = new Thread(() => {
          while (running.get() && !Reflect.ok) Thread.sleep(20)
          val addr = new java.net.InetSocketAddress("127.0.0.1", serverPort)
          while (running.get()) {
            val threads = (0 until 8).map { _ =>
              val bt = new Thread(() => {
                var i = 0
                while (i < burst / 8 && running.get()) {
                  try {
                    val ch = SocketChannel.open(); ch.connect(addr)
                    ch.socket().getOutputStream.write('b')
                    ch.socket().getInputStream.read(); ch.close()
                    totalAccepts.incrementAndGet()
                  } catch { case _: Throwable => }
                  i += 1
                }
              })
              bt.setDaemon(true); bt.start(); bt
            }
            threads.foreach(_.join())
            Thread.sleep(burstMs)
          }
        }, "burster")
        t.setDaemon(true); t.start(); t
      }
    
      // ===================================================================================
      // CE side: real fs2 echo accept loop + migration flood + client churn + blockers + keepalive
      // ===================================================================================
      def networkFor: Network[IO] =
        if (mode == "aio") Network.forAsync[IO] else Network[IO]
    
      // echo one connection then close (short-lived), yielding at IO boundaries
      def handle(sock: Socket[IO]): IO[Unit] =
        sock.read(64).flatMap {
          case Some(chunk) => sock.write(chunk) >> IO.cede
          case None        => IO.unit
        }.attempt.void
    
      def acceptLoop(net: Network[IO]): IO[Unit] =
        net.server(Some(host"127.0.0.1"), Some(Port.fromInt(serverPort).get))
          .map { sock =>
            Stream.eval(handle(sock).guarantee(IO.cede)) // re-arm continuation bounces via cede
          }
          .parJoin(4096)
          .compile
          .drain
    
      // Migration pressure in BURSTS so the pool can go genuinely IDLE between bursts (the prod
      // condition: idle workers parked). Each burst spawns `migrators` short fibers that cede a
      // few times then die; between bursts the pool drains and parks. This forces the accept
      // re-arm continuation to migrate onto a freshly-woken worker while peers are still parked.
      def migrationFlood: IO[Unit] = {
        val burstSize = math.max(1, migrators)
        val oneFiber = (IO.cede >> IO.cede >> IO.cede).void
        (
          List.fill(burstSize)(oneFiber).parSequence_.attempt >>
            IO.sleep(30.millis) // let the pool drain + park between bursts
        ).foreverM
      }
    
      // Kafka-poll-like blocking loops (real IO.blocking, cooperative, no busy spin).
      def blockerLoops: IO[Unit] =
        List.fill(blockers)(
          (IO.blocking { java.util.concurrent.locks.LockSupport.parkNanos(2000000L) } >> IO.cede).foreverM
        ).parSequence_.void
    
      // Outbound client churn to local stub: constant fresh outbound connection FDs across workers.
      def clientChurn(net: Network[IO]): IO[Unit] = {
        val stub = new java.net.InetSocketAddress("127.0.0.1", stubPort)
        val one =
          net.client(SocketAddress(host"127.0.0.1", Port.fromInt(stubPort).get))
            .use { s => s.write(fs2.Chunk.array("q".getBytes)) >> s.read(16).void }
            .attempt.void >> IO.cede
        List.fill(clients)(one.foreverM).parSequence_.void
      }
    
      // Persistent registered sockets: keep KEEPALIVE connections open + reading, so keys spread
      // across all selectors and never go empty (keeps workers legitimately in epoll sometimes).
      def keepaliveHold(net: Network[IO]): IO[Unit] = {
        val one = net.client(SocketAddress(host"127.0.0.1", Port.fromInt(serverPort).get))
          .use { s =>
            (s.write(fs2.Chunk.array("k".getBytes)) >> s.read(16) >> IO.sleep(50.millis)).foreverM
          }.attempt.void
        List.fill(keepalive)(one).parSequence_.void
      }
    
      // Local echo stub for the client churn (separate fs2 server on stubPort).
      def stubServer(net: Network[IO]): IO[Unit] =
        net.server(Some(host"127.0.0.1"), Some(Port.fromInt(stubPort).get))
          .map(s => Stream.eval(s.read(16).flatMap(c => c.traverse_(s.write)).attempt.void))
          .parJoin(2048).compile.drain
    
      def reporter: IO[Unit] =
        (IO.sleep(5.seconds) >> IO {
          val acc = totalAccepts.get(); val pr = totalProbes.get()
          // sample pool idleness: how many workers are parked-idle right now
          val idle = try { val s = snapshot(); s.sels.count(isIdleParked) + "/" + s.sels.size } catch { case _: Throwable => "?" }
          System.out.println(f"[report] accepts=$acc probes=$pr slowProbes=${slowProbes.get()} maxProbeMs=${maxProbeMs.get()} idleWorkers=$idle cand=${candCount.get()} persistent=${persistCount.get()} definite=${defCount.get()}")
        }).foreverM
    
      def run: IO[Unit] = for {
        _   <- IO { System.out.println(s"### SelectorReflect mode=$mode dur=${durS}s migrators=$migrators keepalive=$keepalive blockers=$blockers clients=$clients drivers=$drivers burst=$burst/${burstMs}ms procs=${Runtime.getRuntime.availableProcessors}") }
        net = networkFor
        // start reflection + watchdog once runtime is available (we're inside IOApp so rt is set in main override)
        _   <- IO { if (rt != null) Reflect.init(rt) }
        _   <- IO { startWatchdog(); startProber() }
        _   <- IO { startDrivers(); startBurster() }
        fibers <- List(
                    stubServer(net),
                    acceptLoop(net),
                    clientChurn(net),
                    keepaliveHold(net),
                    blockerLoops,
                    migrationFlood,
                    reporter
                  ).parSequence_.start
        _   <- IO.sleep(durS.seconds)
        _   <- IO { running.set(false) }
        _   <- fibers.cancel.timeout(5.seconds).attempt
        _   <- printFinal
      } yield ()
    
      def printFinal: IO[Unit] = IO {
        System.out.println("\n================= FINAL =================")
        System.out.println(f"mode=$mode accepts=${totalAccepts.get()} probes=${totalProbes.get()} slowProbes=${slowProbes.get()} maxProbeMs=${maxProbeMs.get()}ms")
        System.out.println(f"STRANDS: armed-idle-candidates=${candCount.get()} PERSISTENT=${persistCount.get()} DEFINITE-READY=${defCount.get()}")
        System.out.println("probe latency histogram (ms bucket : count):")
        for (i <- hist.indices) System.out.println(f"  ${histLabels(i)}%8s : ${hist(i).get()}")
        val lf = lastFlagged.get()
        if (lf.nonEmpty) { System.out.println("---- last flagged snapshot ----"); System.out.println(lf) }
        else System.out.println("no stranding flagged")
      }
    
      // Override main so we can grab the IORuntime for reflection before run() executes.
      override protected def runtime: IORuntime = {
        val r = super.runtime; rt = r; r
      }
    }
    !! STRAND-READY: sel#3 LISTEN interest=A READY=A owner=io-compute-blocker-20/TIMED_WAITING
       parked-idle=true anyWorkerInEpoll=false
    
  7. durban commented on Jul 8, 2026

    @durban
    Contributor

    A blocker thread cannot be the owner of a poller, so something is wrong, either with the generated code, or possibly just a race with getting the thread name.

    A heap dump in the known-incorrect state would be really helpful. Or at least the mentioned thread dump.

  8. sideeffffect commented on Jul 8, 2026

    @sideeffffect
    Author
    "AsyncAppender-Worker-STDOUT_JSON_ASYNC" state=WAITING
        at [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
        at [email protected]/java.util.concurrent.locks.LockSupport.park(LockSupport.java:371)
        at [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionNode.block(AbstractQueuedSynchronizer.java:519)
        at [email protected]/java.util.concurrent.ForkJoinPool.unmanagedBlock(ForkJoinPool.java:3780)
        at [email protected]/java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3725)
        at [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1746)
        at [email protected]/java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:420)
        at app//ch.qos.logback.core.AsyncAppenderBase$Worker.run(AsyncAppenderBase.java:298)
    "Common-Cleaner" state=TIMED_WAITING
        at [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
        at [email protected]/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:269)
        at [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1886)
        at [email protected]/java.lang.ref.ReferenceQueue.await(ReferenceQueue.java:71)
        at [email protected]/java.lang.ref.ReferenceQueue.remove0(ReferenceQueue.java:143)
        at [email protected]/java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:218)
        at [email protected]/jdk.internal.ref.CleanerImpl.run(CleanerImpl.java:140)
        at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
        at [email protected]/java.lang.Thread.run(Thread.java:1583)
        at [email protected]/jdk.internal.misc.InnocuousThread.run(InnocuousThread.java:186)
    "Finalizer" state=WAITING
        at [email protected]/java.lang.Object.wait0(Native Method)
        at [email protected]/java.lang.Object.wait(Object.java:366)
        at [email protected]/java.lang.Object.wait(Object.java:339)
        at [email protected]/java.lang.ref.NativeReferenceQueue.await(NativeReferenceQueue.java:48)
        at [email protected]/java.lang.ref.ReferenceQueue.remove0(ReferenceQueue.java:158)
        at [email protected]/java.lang.ref.NativeReferenceQueue.remove(NativeReferenceQueue.java:89)
        at [email protected]/java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:173)
    "HikariPool-1:housekeeper" state=TIMED_WAITING
        at [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
        at [email protected]/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:269)
        at [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1797)
        at [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1182)
        at [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:899)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1070)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
        at [email protected]/java.lang.Thread.run(Thread.java:1583)
    "Notification Thread" state=RUNNABLE
        
    "OkHttp TaskRunner" state=TIMED_WAITING
        at [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
        at [email protected]/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:410)
        at [email protected]/java.util.concurrent.LinkedTransferQueue$DualNode.await(LinkedTransferQueue.java:452)
        at [email protected]/java.util.concurrent.SynchronousQueue$Transferer.xferLifo(SynchronousQueue.java:194)
        at [email protected]/java.util.concurrent.SynchronousQueue.xfer(SynchronousQueue.java:235)
        at [email protected]/java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:338)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1069)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
        at [email protected]/java.lang.Thread.run(Thread.java:1583)
    "OkHttp TaskRunner" state=TIMED_WAITING
        at [email protected]/java.lang.Object.wait0(Native Method)
        at [email protected]/java.lang.Object.wait(Object.java:366)
        at [email protected]/java.lang.Object.wait(Object.java:488)
        at app//okhttp3.internal.concurrent.TaskRunner$RealBackend.coordinatorWait(TaskRunner.kt:294)
        at app//okhttp3.internal.concurrent.TaskRunner.awaitTaskToRun(TaskRunner.kt:218)
        at app//okhttp3.internal.concurrent.TaskRunner$runnable$1.run(TaskRunner.kt:59)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
        at [email protected]/java.lang.Thread.run(Thread.java:1583)
    "OkHttp localhost" state=RUNNABLE
        at [email protected]/sun.nio.ch.Net.poll(Native Method)
        at [email protected]/sun.nio.ch.NioSocketImpl.park(NioSocketImpl.java:191)
        at [email protected]/sun.nio.ch.NioSocketImpl.park(NioSocketImpl.java:201)
        at [email protected]/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:309)
        at [email protected]/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:346)
        at [email protected]/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:796)
        at [email protected]/java.net.Socket$SocketInputStream.read(Socket.java:1099)
        at app//okio.InputStreamSource.read(JvmOkio.kt:94)
        at app//okio.AsyncTimeout$source$1.read(AsyncTimeout.kt:125)
        at app//okio.RealBufferedSource.request(RealBufferedSource.kt:206)
        at app//okio.RealBufferedSource.require(RealBufferedSource.kt:199)
        at app//okhttp3.internal.http2.Http2Reader.nextFrame(Http2Reader.kt:89)
        at app//okhttp3.internal.http2.Http2Connection$ReaderRunnable.invoke(Http2Connection.kt:618)
        at app//okhttp3.internal.http2.Http2Connection$ReaderRunnable.invoke(Http2Connection.kt:609)
        at app//okhttp3.internal.concurrent.TaskQueue$execute$1.runOnce(TaskQueue.kt:98)
        at app//okhttp3.internal.concurrent.TaskRunner.runTask(TaskRunner.kt:116)
        at app//okhttp3.internal.concurrent.TaskRunner.access$runTask(TaskRunner.kt:42)
        at app//okhttp3.internal.concurrent.TaskRunner$runnable$1.run(TaskRunner.kt:65)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
        at [email protected]/java.lang.Thread.run(Thread.java:1583)
    "Okio Watchdog" state=TIMED_WAITING
        at [email protected]/java.lang.Object.wait0(Native Method)
        at [email protected]/java.lang.Object.wait(Object.java:366)
        at app//okio.AsyncTimeout$Companion.awaitTimeout$okio(AsyncTimeout.kt:302)
        at app//okio.AsyncTimeout$Watchdog.run(AsyncTimeout.kt:183)
    "PostgreSQL-JDBC-Cleaner" state=TIMED_WAITING
        at [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
        at [email protected]/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:269)
        at [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1886)
        at [email protected]/java.lang.ref.ReferenceQueue.await(ReferenceQueue.java:71)
        at [email protected]/java.lang.ref.ReferenceQueue.remove0(ReferenceQueue.java:143)
        at [email protected]/java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:218)
        at app//org.postgresql.util.LazyCleaner$1.run(LazyCleaner.java:131)
        at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
        at [email protected]/java.lang.Thread.run(Thread.java:1583)
    "RMI TCP Accept-0" state=RUNNABLE
        at [email protected]/sun.nio.ch.Net.accept(Native Method)
        at [email protected]/sun.nio.ch.NioSocketImpl.accept(NioSocketImpl.java:748)
        at [email protected]/java.net.ServerSocket.implAccept(ServerSocket.java:698)
        at [email protected]/java.net.ServerSocket.platformImplAccept(ServerSocket.java:663)
        at [email protected]/java.net.ServerSocket.implAccept(ServerSocket.java:639)
        at [email protected]/java.net.ServerSocket.implAccept(ServerSocket.java:585)
        at [email protected]/java.net.ServerSocket.accept(ServerSocket.java:543)
        at [email protected]/sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(TCPTransport.java:424)
        at [email protected]/sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(TCPTransport.java:388)
        at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
        at [email protected]/java.lang.Thread.run(Thread.java:1583)
    "RMI TCP Accept-1099" state=RUNNABLE
        at [email protected]/sun.nio.ch.Net.accept(Native Method)
        at [email protected]/sun.nio.ch.NioSocketImpl.accept(NioSocketImpl.java:748)
        at [email protected]/java.net.ServerSocket.implAccept(ServerSocket.java:698)
        at [email protected]/java.net.ServerSocket.platformImplAccept(ServerSocket.java:663)
        at [email protected]/java.net.ServerSocket.implAccept(ServerSocket.java:639)
        at [email protected]/java.net.ServerSocket.implAccept(ServerSocket.java:585)
        at [email protected]/java.net.ServerSocket.accept(ServerSocket.java:543)
        at [email protected]/sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(TCPTransport.java:424)
        at [email protected]/sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(TCPTransport.java:388)
        at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
        at [email protected]/java.lang.Thread.run(Thread.java:1583)
    "Reference Handler" state=RUNNABLE
        at [email protected]/java.lang.ref.Reference.waitForReferencePendingList(Native Method)
        at [email protected]/java.lang.ref.Reference.processPendingReferences(Reference.java:246)
        at [email protected]/java.lang.ref.Reference$ReferenceHandler.run(Reference.java:208)
    "SentryAsyncConnection-0" state=RUNNABLE
        at [email protected]/java.io.RandomAccessFile.seek0(Native Method)
        at [email protected]/java.io.RandomAccessFile.seek(RandomAccessFile.java:636)
        at [email protected]/java.util.zip.ZipFile$Source.readAt(ZipFile.java:1540)
        at [email protected]/java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:956)
        at [email protected]/java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:463)
        at [email protected]/java.util.zip.InflaterInputStream.read(InflaterInputStream.java:175)
        at [email protected]/jdk.internal.loader.Resource.getBytes(Resource.java:126)
        at [email protected]/jdk.internal.loader.URLClassPath$JarLoader$2.getBytes(URLClassPath.java:862)
        at [email protected]/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:859)
        at [email protected]/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760)
        at [email protected]/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681)
        at [email protected]/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639)
        at [email protected]/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
        at [email protected]/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
        at app//io.sentry.clientreport.AtomicClientReportStorage.lambda$new$0(AtomicClientReportStorage.java:25)
        at app//io.sentry.clientreport.AtomicClientReportStorage$$Lambda/0x0000000100324590.evaluate(Unknown Source)
        at app//io.sentry.util.LazyEvaluator.getValue(LazyEvaluator.java:39)
        at app//io.sentry.clientreport.AtomicClientReportStorage.resetCountsAndGet(AtomicClientReportStorage.java:51)
        at app//io.sentry.clientreport.ClientReportRecorder.resetCountsAndGenerateClientReport(ClientReportRecorder.java:179)
        at app//io.sentry.clientreport.ClientReportRecorder.attachReportToEnvelope(ClientReportRecorder.java:36)
        at app//io.sentry.transport.AsyncHttpTransport$EnvelopeSender.flush(AsyncHttpTransport.java:294)
        at app//io.sentry.transport.AsyncHttpTransport$EnvelopeSender.run(AsyncHttpTransport.java:247)
        at [email protected]/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
        at [email protected]/java.util.concurrent.FutureTask.run(FutureTask.java:317)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
        at [email protected]/java.lang.Thread.run(Thread.java:1583)
    "SentryExecutorServiceThreadFactory-0" state=TIMED_WAITING
        at [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
        at [email protected]/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:269)
        at [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1797)
        at [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1182)
        at [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:899)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1070)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
        at [email protected]/java.lang.Thread.run(Thread.java:1583)
    "Signal Dispatcher" state=RUNNABLE
        
    "fs2-kafka-consumer-54" state=RUNNABLE
        at [email protected]/sun.nio.ch.EPoll.wait(Native Method)
        at [email protected]/sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:121)
        at [email protected]/sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:130)
        at [email protected]/sun.nio.ch.SelectorImpl.select(SelectorImpl.java:142)
        at app//org.apache.kafka.common.network.Selector.select(Selector.java:894)
        at app//org.apache.kafka.common.network.Selector.poll(Selector.java:485)
        at app//org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:596)
        at app//org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:282)
        at app//org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:253)
        at app//org.apache.kafka.clients.consumer.internals.ClassicKafkaConsumer.pollForFetches(ClassicKafkaConsumer.java:692)
        at app//org.apache.kafka.clients.consumer.internals.ClassicKafkaConsumer.poll(ClassicKafkaConsumer.java:623)
        at app//org.apache.kafka.clients.consumer.internals.ClassicKafkaConsumer.poll(ClassicKafkaConsumer.java:596)
        at app//org.apache.kafka.clients.consumer.KafkaConsumer.poll(KafkaConsumer.java:874)
        at app//fs2.kafka.internal.KafkaConsumerActor.$anonfun$poll$6(KafkaConsumerActor.scala:219)
        at app//fs2.kafka.internal.KafkaConsumerActor$$Lambda/0x0000000100f63648.apply(Unknown Source)
        at app//fs2.kafka.internal.WithConsumer$$anon$1.$anonfun$blocking$1(WithConsumer.scala:36)
        at app//fs2.kafka.internal.WithConsumer$$anon$1$$Lambda/0x0000000100ee6918.apply(Unknown Source)
        at app//cats.effect.IOFiber.runLoop(IOFiber.scala:280)
        at app//cats.effect.IOFiber.autoCedeR(IOFiber.scala:1460)
        at app//cats.effect.IOFiber.run(IOFiber.scala:129)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
        at [email protected]/java.lang.Thread.run(Thread.java:1583)
    "fs2-kafka-consumer-56" state=RUNNABLE
        at [email protected]/sun.nio.ch.EPoll.wait(Native Method)
        at [email protected]/sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:121)
        at [email protected]/sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:130)
        at [email protected]/sun.nio.ch.SelectorImpl.select(SelectorImpl.java:142)
        at app//org.apache.kafka.common.network.Selector.select(Selector.java:894)
        at app//org.apache.kafka.common.network.Selector.poll(Selector.java:485)
        at app//org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:596)
        at app//org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:282)
        at app//org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:253)
        at app//org.apache.kafka.clients.consumer.internals.ClassicKafkaConsumer.pollForFetches(ClassicKafkaConsumer.java:692)
        at app//org.apache.kafka.clients.consumer.internals.ClassicKafkaConsumer.poll(ClassicKafkaConsumer.java:623)
        at app//org.apache.kafka.clients.consumer.internals.ClassicKafkaConsumer.poll(ClassicKafkaConsumer.java:596)
        at app//org.apache.kafka.clients.consumer.KafkaConsumer.poll(KafkaConsumer.java:874)
        at app//fs2.kafka.internal.KafkaConsumerActor.$anonfun$poll$6(KafkaConsumerActor.scala:219)
        at app//fs2.kafka.internal.KafkaConsumerActor$$Lambda/0x0000000100f63648.apply(Unknown Source)
        at app//fs2.kafka.internal.WithConsumer$$anon$1.$anonfun$blocking$1(WithConsumer.scala:36)
        at app//fs2.kafka.internal.WithConsumer$$anon$1$$Lambda/0x0000000100ee6918.apply(Unknown Source)
        at app//cats.effect.IOFiber.runLoop(IOFiber.scala:280)
        at app//cats.effect.IOFiber.autoCedeR(IOFiber.scala:1460)
        at app//cats.effect.IOFiber.run(IOFiber.scala:129)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
        at [email protected]/java.lang.Thread.run(Thread.java:1583)
    "fs2-kafka-consumer-58" state=RUNNABLE
        at [email protected]/sun.nio.ch.EPoll.wait(Native Method)
        at [email protected]/sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:121)
        at [email protected]/sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:130)
        at [email protected]/sun.nio.ch.SelectorImpl.select(SelectorImpl.java:142)
        at app//org.apache.kafka.common.network.Selector.select(Selector.java:894)
        at app//org.apache.kafka.common.network.Selector.poll(Selector.java:485)
        at app//org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:596)
        at app//org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:282)
        at app//org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:253)
        at app//org.apache.kafka.clients.consumer.internals.ClassicKafkaConsumer.pollForFetches(ClassicKafkaConsumer.java:692)
        at app//org.apache.kafka.clients.consumer.internals.ClassicKafkaConsumer.poll(ClassicKafkaConsumer.java:623)
        at app//org.apache.kafka.clients.consumer.internals.ClassicKafkaConsumer.poll(ClassicKafkaConsumer.java:596)
        at app//org.apache.kafka.clients.consumer.KafkaConsumer.poll(KafkaConsumer.java:874)
        at app//fs2.kafka.internal.KafkaConsumerActor.$anonfun$poll$6(KafkaConsumerActor.scala:219)
        at app//fs2.kafka.internal.KafkaConsumerActor$$Lambda/0x0000000100f63648.apply(Unknown Source)
        at app//fs2.kafka.internal.WithConsumer$$anon$1.$anonfun$blocking$1(WithConsumer.scala:36)
        at app//fs2.kafka.internal.WithConsumer$$anon$1$$Lambda/0x0000000100ee6918.apply(Unknown Source)
        at app//cats.effect.IOFiber.runLoop(IOFiber.scala:280)
        at app//cats.effect.IOFiber.autoCedeR(IOFiber.scala:1460)
        at app//cats.effect.IOFiber.run(IOFiber.scala:129)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
        at [email protected]/java.lang.Thread.run(Thread.java:1583)
    "fs2-kafka-consumer-60" state=RUNNABLE
        at [email protected]/sun.nio.ch.EPoll.wait(Native Method)
        at [email protected]/sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:121)
        at [email protected]/sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:130)
        at [email protected]/sun.nio.ch.SelectorImpl.select(SelectorImpl.java:142)
        at app//org.apache.kafka.common.network.Selector.select(Selector.java:894)
        at app//org.apache.kafka.common.network.Selector.poll(Selector.java:485)
        at app//org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:596)
        at app//org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:282)
        at app//org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:253)
        at app//org.apache.kafka.clients.consumer.internals.ClassicKafkaConsumer.pollForFetches(ClassicKafkaConsumer.java:692)
        at app//org.apache.kafka.clients.consumer.internals.ClassicKafkaConsumer.poll(ClassicKafkaConsumer.java:623)
        at app//org.apache.kafka.clients.consumer.internals.ClassicKafkaConsumer.poll(ClassicKafkaConsumer.java:596)
        at app//org.apache.kafka.clients.consumer.KafkaConsumer.poll(KafkaConsumer.java:874)
        at app//fs2.kafka.internal.KafkaConsumerActor.$anonfun$poll$6(KafkaConsumerActor.scala:219)
        at app//fs2.kafka.internal.KafkaConsumerActor$$Lambda/0x0000000100f63648.apply(Unknown Source)
        at app//fs2.kafka.internal.WithConsumer$$anon$1.$anonfun$blocking$1(WithConsumer.scala:36)
        at app//fs2.kafka.internal.WithConsumer$$anon$1$$Lambda/0x0000000100ee6918.apply(Unknown Source)
        at app//cats.effect.IOFiber.runLoop(IOFiber.scala:280)
        at app//cats.effect.IOFiber.autoCedeR(IOFiber.scala:1460)
        at app//cats.effect.IOFiber.run(IOFiber.scala:129)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
        at [email protected]/java.lang.Thread.run(Thread.java:1583)
    "fs2-kafka-consumer-62" state=RUNNABLE
        at [email protected]/sun.nio.ch.EPoll.wait(Native Method)
        at [email protected]/sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:121)
        at [email protected]/sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:130)
        at [email protected]/sun.nio.ch.SelectorImpl.select(SelectorImpl.java:142)
        at app//org.apache.kafka.common.network.Selector.select(Selector.java:894)
        at app//org.apache.kafka.common.network.Selector.poll(Selector.java:485)
        at app//org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:596)
        at app//org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:282)
        at app//org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:253)
        at app//org.apache.kafka.clients.consumer.internals.ClassicKafkaConsumer.pollForFetches(ClassicKafkaConsumer.java:692)
        at app//org.apache.kafka.clients.consumer.internals.ClassicKafkaConsumer.poll(ClassicKafkaConsumer.java:623)
        at app//org.apache.kafka.clients.consumer.internals.ClassicKafkaConsumer.poll(ClassicKafkaConsumer.java:596)
        at app//org.apache.kafka.clients.consumer.KafkaConsumer.poll(KafkaConsumer.java:874)
        at app//fs2.kafka.internal.KafkaConsumerActor.$anonfun$poll$6(KafkaConsumerActor.scala:219)
        at app//fs2.kafka.internal.KafkaConsumerActor$$Lambda/0x0000000100f63648.apply(Unknown Source)
        at app//fs2.kafka.internal.WithConsumer$$anon$1.$anonfun$blocking$1(WithConsumer.scala:36)
        at app//fs2.kafka.internal.WithConsumer$$anon$1$$Lambda/0x0000000100ee6918.apply(Unknown Source)
        at app//cats.effect.IOFiber.runLoop(IOFiber.scala:280)
        at app//cats.effect.IOFiber.autoCedeR(IOFiber.scala:1460)
        at app//cats.effect.IOFiber.run(IOFiber.scala:129)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
        at [email protected]/java.lang.Thread.run(Thread.java:1583)
    "fs2-kafka-consumer-64" state=RUNNABLE
        at [email protected]/sun.nio.ch.EPoll.wait(Native Method)
        at [email protected]/sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:121)
        at [email protected]/sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:130)
        at [email protected]/sun.nio.ch.SelectorImpl.select(SelectorImpl.java:142)
        at app//org.apache.kafka.common.network.Selector.select(Selector.java:894)
        at app//org.apache.kafka.common.network.Selector.poll(Selector.java:485)
        at app//org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:596)
        at app//org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:282)
        at app//org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:253)
        at app//org.apache.kafka.clients.consumer.internals.ClassicKafkaConsumer.pollForFetches(ClassicKafkaConsumer.java:692)
        at app//org.apache.kafka.clients.consumer.internals.ClassicKafkaConsumer.poll(ClassicKafkaConsumer.java:623)
        at app//org.apache.kafka.clients.consumer.internals.ClassicKafkaConsumer.poll(ClassicKafkaConsumer.java:596)
        at app//org.apache.kafka.clients.consumer.KafkaConsumer.poll(KafkaConsumer.java:874)
        at app//fs2.kafka.internal.KafkaConsumerActor.$anonfun$poll$6(KafkaConsumerActor.scala:219)
        at app//fs2.kafka.internal.KafkaConsumerActor$$Lambda/0x0000000100f63648.apply(Unknown Source)
        at app//fs2.kafka.internal.WithConsumer$$anon$1.$anonfun$blocking$1(WithConsumer.scala:36)
        at app//fs2.kafka.internal.WithConsumer$$anon$1$$Lambda/0x0000000100ee6918.apply(Unknown Source)
        at app//cats.effect.IOFiber.runLoop(IOFiber.scala:280)
        at app//cats.effect.IOFiber.autoCedeR(IOFiber.scala:1460)
        at app//cats.effect.IOFiber.run(IOFiber.scala:129)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
        at [email protected]/java.lang.Thread.run(Thread.java:1583)
    "io-compute-0" state=RUNNABLE
        at [email protected]/sun.nio.ch.EPoll.wait(Native Method)
        at [email protected]/sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:121)
        at [email protected]/sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:130)
        at [email protected]/sun.nio.ch.SelectorImpl.select(SelectorImpl.java:142)
        at app//cats.effect.unsafe.SelectorSystem.poll(SelectorSystem.scala:47)
        at app//cats.effect.unsafe.SelectorSystem.poll(SelectorSystem.scala:28)
        at app//cats.effect.unsafe.WorkerThread.parkLoopUntilNextSleeper$1(WorkerThread.scala:731)
        at app//cats.effect.unsafe.WorkerThread.park$1(WorkerThread.scala:605)
        at app//cats.effect.unsafe.WorkerThread.lookForWork$1(WorkerThread.scala:579)
        at app//cats.effect.unsafe.WorkerThread.run(WorkerThread.scala:942)
    "io-compute-1" state=RUNNABLE
        at [email protected]/sun.nio.ch.EPoll.wait(Native Method)
        at [email protected]/sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:121)
        at [email protected]/sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:130)
        at [email protected]/sun.nio.ch.SelectorImpl.select(SelectorImpl.java:142)
        at app//cats.effect.unsafe.SelectorSystem.poll(SelectorSystem.scala:47)
        at app//cats.effect.unsafe.SelectorSystem.poll(SelectorSystem.scala:28)
        at app//cats.effect.unsafe.WorkerThread.parkLoopUntilNextSleeper$1(WorkerThread.scala:731)
        at app//cats.effect.unsafe.WorkerThread.park$1(WorkerThread.scala:605)
        at app//cats.effect.unsafe.WorkerThread.lookForWork$1(WorkerThread.scala:579)
        at app//cats.effect.unsafe.WorkerThread.run(WorkerThread.scala:942)
    "io-compute-2" state=RUNNABLE
        at [email protected]/sun.nio.ch.EPoll.wait(Native Method)
        at [email protected]/sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:121)
        at [email protected]/sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:130)
        at [email protected]/sun.nio.ch.SelectorImpl.select(SelectorImpl.java:142)
        at app//cats.effect.unsafe.SelectorSystem.poll(SelectorSystem.scala:47)
        at app//cats.effect.unsafe.SelectorSystem.poll(SelectorSystem.scala:28)
        at app//cats.effect.unsafe.WorkerThread.parkLoopUntilNextSleeper$1(WorkerThread.scala:731)
        at app//cats.effect.unsafe.WorkerThread.park$1(WorkerThread.scala:605)
        at app//cats.effect.unsafe.WorkerThread.lookForWork$1(WorkerThread.scala:475)
        at app//cats.effect.unsafe.WorkerThread.run(WorkerThread.scala:942)
    "io-compute-3" state=RUNNABLE
        at [email protected]/sun.nio.ch.EPoll.wait(Native Method)
        at [email protected]/sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:121)
        at [email protected]/sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:130)
        at [email protected]/sun.nio.ch.SelectorImpl.select(SelectorImpl.java:142)
        at app//cats.effect.unsafe.SelectorSystem.poll(SelectorSystem.scala:47)
        at app//cats.effect.unsafe.SelectorSystem.poll(SelectorSystem.scala:28)
        at app//cats.effect.unsafe.WorkerThread.parkLoopUntilNextSleeper$1(WorkerThread.scala:731)
        at app//cats.effect.unsafe.WorkerThread.park$1(WorkerThread.scala:605)
        at app//cats.effect.unsafe.WorkerThread.lookForWork$1(WorkerThread.scala:475)
        at app//cats.effect.unsafe.WorkerThread.run(WorkerThread.scala:942)
    "io-compute-blocker-12" state=TIMED_WAITING
        at [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
        at [email protected]/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:410)
        at [email protected]/java.util.concurrent.LinkedTransferQueue$DualNode.await(LinkedTransferQueue.java:452)
        at [email protected]/java.util.concurrent.SynchronousQueue$Transferer.xferLifo(SynchronousQueue.java:194)
        at [email protected]/java.util.concurrent.SynchronousQueue.xfer(SynchronousQueue.java:235)
        at [email protected]/java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:338)
        at app//cats.effect.unsafe.WorkerThread.run(WorkerThread.scala:809)
    "io-compute-blocker-14" state=TIMED_WAITING
        at [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
        at [email protected]/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:410)
        at [email protected]/java.util.concurrent.LinkedTransferQueue$DualNode.await(LinkedTransferQueue.java:452)
        at [email protected]/java.util.concurrent.SynchronousQueue$Transferer.xferLifo(SynchronousQueue.java:194)
        at [email protected]/java.util.concurrent.SynchronousQueue.xfer(SynchronousQueue.java:235)
        at [email protected]/java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:338)
        at app//cats.effect.unsafe.WorkerThread.run(WorkerThread.scala:809)
    "io-compute-blocker-16" state=TIMED_WAITING
        at [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
        at [email protected]/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:410)
        at [email protected]/java.util.concurrent.LinkedTransferQueue$DualNode.await(LinkedTransferQueue.java:452)
        at [email protected]/java.util.concurrent.SynchronousQueue$Transferer.xferLifo(SynchronousQueue.java:194)
        at [email protected]/java.util.concurrent.SynchronousQueue.xfer(SynchronousQueue.java:235)
        at [email protected]/java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:338)
        at app//cats.effect.unsafe.WorkerThread.run(WorkerThread.scala:809)
    "io-compute-blocker-23" state=TIMED_WAITING
        at [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
        at [email protected]/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:410)
        at [email protected]/java.util.concurrent.LinkedTransferQueue$DualNode.await(LinkedTransferQueue.java:452)
        at [email protected]/java.util.concurrent.SynchronousQueue$Transferer.xferLifo(SynchronousQueue.java:194)
        at [email protected]/java.util.concurrent.SynchronousQueue.xfer(SynchronousQueue.java:235)
        at [email protected]/java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:338)
        at app//cats.effect.unsafe.WorkerThread.run(WorkerThread.scala:809)
    "kafka-coordinator-heartbeat-thread
        auth-service" state=WAITING
        at [email protected]/java.lang.Object.wait0(Native Method)
        at [email protected]/java.lang.Object.wait(Object.java:366)
        at [email protected]/java.lang.Object.wait(Object.java:339)
        at app//org.apache.kafka.clients.consumer.internals.AbstractCoordinator$HeartbeatThread.run(AbstractCoordinator.java:1489)
    "kafka-coordinator-heartbeat-thread
        auth-service" state=WAITING
        at [email protected]/java.lang.Object.wait0(Native Method)
        at [email protected]/java.lang.Object.wait(Object.java:366)
        at [email protected]/java.lang.Object.wait(Object.java:339)
        at app//org.apache.kafka.clients.consumer.internals.AbstractCoordinator$HeartbeatThread.run(AbstractCoordinator.java:1489)
    "kafka-coordinator-heartbeat-thread
        auth-service" state=WAITING
        at [email protected]/java.lang.Object.wait0(Native Method)
        at [email protected]/java.lang.Object.wait(Object.java:366)
        at [email protected]/java.lang.Object.wait(Object.java:339)
        at app//org.apache.kafka.clients.consumer.internals.AbstractCoordinator$HeartbeatThread.run(AbstractCoordinator.java:1489)
    "kafka-coordinator-heartbeat-thread
        auth-service" state=WAITING
        at [email protected]/java.lang.Object.wait0(Native Method)
        at [email protected]/java.lang.Object.wait(Object.java:366)
        at [email protected]/java.lang.Object.wait(Object.java:339)
        at app//org.apache.kafka.clients.consumer.internals.AbstractCoordinator$HeartbeatThread.run(AbstractCoordinator.java:1489)
    "kafka-coordinator-heartbeat-thread
        auth-service" state=WAITING
        at [email protected]/java.lang.Object.wait0(Native Method)
        at [email protected]/java.lang.Object.wait(Object.java:366)
        at [email protected]/java.lang.Object.wait(Object.java:339)
        at app//org.apache.kafka.clients.consumer.internals.AbstractCoordinator$HeartbeatThread.run(AbstractCoordinator.java:1489)
    "kafka-coordinator-heartbeat-thread
        auth-service" state=WAITING
        at [email protected]/java.lang.Object.wait0(Native Method)
        at [email protected]/java.lang.Object.wait(Object.java:366)
        at [email protected]/java.lang.Object.wait(Object.java:339)
        at app//org.apache.kafka.clients.consumer.internals.AbstractCoordinator$HeartbeatThread.run(AbstractCoordinator.java:1489)
    "kafka-producer-network-thread
        auth-service-producer-auth-events-auth-service-7db976c464-jj5k5-canary" state=RUNNABLE
        at [email protected]/sun.nio.ch.EPoll.wait(Native Method)
        at [email protected]/sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:121)
        at [email protected]/sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:130)
        at [email protected]/sun.nio.ch.SelectorImpl.select(SelectorImpl.java:142)
        at app//org.apache.kafka.common.network.Selector.select(Selector.java:894)
        at app//org.apache.kafka.common.network.Selector.poll(Selector.java:485)
        at app//org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:596)
        at app//org.apache.kafka.clients.producer.internals.Sender.runOnce(Sender.java:349)
        at app//org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:251)
        at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
        at [email protected]/java.lang.Thread.run(Thread.java:1583)
    "kafka-producer-network-thread
        auth-service-producer-auth-events-auth-service-7db976c464-jj5k5-prod" state=RUNNABLE
        at [email protected]/sun.nio.ch.EPoll.wait(Native Method)
        at [email protected]/sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:121)
        at [email protected]/sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:130)
        at [email protected]/sun.nio.ch.SelectorImpl.select(SelectorImpl.java:142)
        at app//org.apache.kafka.common.network.Selector.select(Selector.java:894)
        at app//org.apache.kafka.common.network.Selector.poll(Selector.java:485)
        at app//org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:596)
        at app//org.apache.kafka.clients.producer.internals.Sender.runOnce(Sender.java:349)
        at app//org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:251)
        at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
        at [email protected]/java.lang.Thread.run(Thread.java:1583)
    "kafka-producer-network-thread
        auth-service-producer-refresh-token-updates-auth-service-7db976c464-jj5k5-canary" state=RUNNABLE
        at [email protected]/sun.nio.ch.EPoll.wait(Native Method)
        at [email protected]/sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:121)
        at [email protected]/sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:130)
        at [email protected]/sun.nio.ch.SelectorImpl.select(SelectorImpl.java:142)
        at app//org.apache.kafka.common.network.Selector.select(Selector.java:894)
        at app//org.apache.kafka.common.network.Selector.poll(Selector.java:485)
        at app//org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:596)
        at app//org.apache.kafka.clients.producer.internals.Sender.runOnce(Sender.java:349)
        at app//org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:251)
        at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
        at [email protected]/java.lang.Thread.run(Thread.java:1583)
    "kafka-producer-network-thread
        auth-service-producer-refresh-token-updates-auth-service-7db976c464-jj5k5-prod" state=RUNNABLE
        at [email protected]/sun.nio.ch.EPoll.wait(Native Method)
        at [email protected]/sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:121)
        at [email protected]/sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:130)
        at [email protected]/sun.nio.ch.SelectorImpl.select(SelectorImpl.java:142)
        at app//org.apache.kafka.common.network.Selector.select(Selector.java:894)
        at app//org.apache.kafka.common.network.Selector.poll(Selector.java:485)
        at app//org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:596)
        at app//org.apache.kafka.clients.producer.internals.Sender.runOnce(Sender.java:349)
        at app//org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:251)
        at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
        at [email protected]/java.lang.Thread.run(Thread.java:1583)
    "main" state=WAITING
        at [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
        at [email protected]/java.util.concurrent.locks.LockSupport.park(LockSupport.java:371)
        at [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionNode.block(AbstractQueuedSynchronizer.java:519)
        at [email protected]/java.util.concurrent.ForkJoinPool.unmanagedBlock(ForkJoinPool.java:3780)
        at [email protected]/java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3725)
        at [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1746)
        at [email protected]/java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:420)
        at app//cats.effect.IOApp.$anonfun$main$22(IOApp.scala:547)
        at app//cats.effect.IOApp$$Lambda/0x00000001004499e0.apply(Unknown Source)
        at app//scala.concurrent.BlockContext$DefaultBlockContext$.blockOn(BlockContext.scala:62)
        at app//scala.concurrent.package$.blocking(package.scala:125)
        at app//cats.effect.IOApp.main(IOApp.scala:547)
        at app//cats.effect.IOApp.main$(IOApp.scala:402)
        at app//com.chilipiper.auth.service.server.Main$.main(Main.scala:59)
        at app//com.chilipiper.auth.service.server.Main.main(Main.scala)
    "micrometer-kafka-metrics" state=TIMED_WAITING
        at [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
        at [email protected]/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:269)
        at [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1797)
        at [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1182)
        at [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:899)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1070)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
        at [email protected]/java.lang.Thread.run(Thread.java:1583)
    "micrometer-kafka-metrics" state=TIMED_WAITING
        at [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
        at [email protected]/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:269)
        at [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1797)
        at [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1182)
        at [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:899)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1070)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
        at [email protected]/java.lang.Thread.run(Thread.java:1583)
    "micrometer-kafka-metrics" state=TIMED_WAITING
        at [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
        at [email protected]/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:269)
        at [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1797)
        at [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1182)
        at [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:899)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1070)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
        at [email protected]/java.lang.Thread.run(Thread.java:1583)
    "micrometer-kafka-metrics" state=TIMED_WAITING
        at [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
        at [email protected]/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:269)
        at [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1797)
        at [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1182)
        at [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:899)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1070)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
        at [email protected]/java.lang.Thread.run(Thread.java:1583)
    "micrometer-kafka-metrics" state=TIMED_WAITING
        at [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
        at [email protected]/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:269)
        at [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1797)
        at [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1182)
        at [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:899)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1070)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
        at [email protected]/java.lang.Thread.run(Thread.java:1583)
    "micrometer-kafka-metrics" state=TIMED_WAITING
        at [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
        at [email protected]/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:269)
        at [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1797)
        at [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1182)
        at [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:899)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1070)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
        at [email protected]/java.lang.Thread.run(Thread.java:1583)
    "micrometer-kafka-metrics" state=TIMED_WAITING
        at [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
        at [email protected]/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:269)
        at [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1797)
        at [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1182)
        at [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:899)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1070)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
        at [email protected]/java.lang.Thread.run(Thread.java:1583)
    "micrometer-kafka-metrics" state=TIMED_WAITING
        at [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
        at [email protected]/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:269)
        at [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1797)
        at [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1182)
        at [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:899)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1070)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
        at [email protected]/java.lang.Thread.run(Thread.java:1583)
    "micrometer-kafka-metrics" state=TIMED_WAITING
        at [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
        at [email protected]/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:269)
        at [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1797)
        at [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1182)
        at [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:899)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1070)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
        at [email protected]/java.lang.Thread.run(Thread.java:1583)
    "micrometer-kafka-metrics" state=TIMED_WAITING
        at [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
        at [email protected]/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:269)
        at [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1797)
        at [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1182)
        at [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:899)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1070)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
        at [email protected]/java.lang.Thread.run(Thread.java:1583)
    "okhttp-dispatch-3" state=TIMED_WAITING
        at [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
        at [email protected]/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:410)
        at [email protected]/java.util.concurrent.LinkedTransferQueue$DualNode.await(LinkedTransferQueue.java:452)
        at [email protected]/java.util.concurrent.SynchronousQueue$Transferer.xferLifo(SynchronousQueue.java:194)
        at [email protected]/java.util.concurrent.SynchronousQueue.xfer(SynchronousQueue.java:235)
        at [email protected]/java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:338)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1069)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
        at [email protected]/java.lang.Thread.run(Thread.java:1583)
    "pool-2-thread-1" state=WAITING
        at [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
        at [email protected]/java.util.concurrent.locks.LockSupport.park(LockSupport.java:371)
        at [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionNode.block(AbstractQueuedSynchronizer.java:519)
        at [email protected]/java.util.concurrent.ForkJoinPool.unmanagedBlock(ForkJoinPool.java:3780)
        at [email protected]/java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3725)
        at [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1746)
        at [email protected]/java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:435)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1070)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
        at [email protected]/java.lang.Thread.run(Thread.java:1583)
    "pool-2-thread-2" state=WAITING
        at [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
        at [email protected]/java.util.concurrent.locks.LockSupport.park(LockSupport.java:371)
        at [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionNode.block(AbstractQueuedSynchronizer.java:519)
        at [email protected]/java.util.concurrent.ForkJoinPool.unmanagedBlock(ForkJoinPool.java:3780)
        at [email protected]/java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3725)
        at [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1746)
        at [email protected]/java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:435)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1070)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
        at [email protected]/java.lang.Thread.run(Thread.java:1583)
    "pool-2-thread-3" state=WAITING
        at [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
        at [email protected]/java.util.concurrent.locks.LockSupport.park(LockSupport.java:371)
        at [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionNode.block(AbstractQueuedSynchronizer.java:519)
        at [email protected]/java.util.concurrent.ForkJoinPool.unmanagedBlock(ForkJoinPool.java:3780)
        at [email protected]/java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3725)
        at [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1746)
        at [email protected]/java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:435)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1070)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
        at [email protected]/java.lang.Thread.run(Thread.java:1583)
    "pool-2-thread-4" state=WAITING
        at [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
        at [email protected]/java.util.concurrent.locks.LockSupport.park(LockSupport.java:371)
        at [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionNode.block(AbstractQueuedSynchronizer.java:519)
        at [email protected]/java.util.concurrent.ForkJoinPool.unmanagedBlock(ForkJoinPool.java:3780)
        at [email protected]/java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3725)
        at [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1746)
        at [email protected]/java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:435)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1070)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
        at [email protected]/java.lang.Thread.run(Thread.java:1583)
    "prometheus-metrics-scheduler-0" state=WAITING
        at [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
        at [email protected]/java.util.concurrent.locks.LockSupport.park(LockSupport.java:371)
        at [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionNode.block(AbstractQueuedSynchronizer.java:519)
        at [email protected]/java.util.concurrent.ForkJoinPool.unmanagedBlock(ForkJoinPool.java:3780)
        at [email protected]/java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3725)
        at [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1746)
        at [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1170)
        at [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:899)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1070)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
        at [email protected]/java.lang.Thread.run(Thread.java:1583)
    "sre197-accept-selfprobe" state=RUNNABLE
        at [email protected]/sun.nio.ch.Net.poll(Native Method)
        at [email protected]/sun.nio.ch.NioSocketImpl.park(NioSocketImpl.java:191)
        at [email protected]/sun.nio.ch.NioSocketImpl.timedRead(NioSocketImpl.java:280)
        at [email protected]/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:304)
        at [email protected]/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:346)
        at [email protected]/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:796)
        at [email protected]/java.net.Socket$SocketInputStream.read(Socket.java:1099)
        at [email protected]/java.net.Socket$SocketInputStream.read(Socket.java:1093)
        at app//com.chilipiper.auth.service.server.Main$$anon$3.run(Main.scala:460)
    "sre197-midstall-watchdog" state=RUNNABLE
        at [email protected]/java.lang.Thread.dumpThreads(Native Method)
        at [email protected]/java.lang.Thread.getAllStackTraces(Thread.java:2522)
        at app//com.chilipiper.auth.service.server.Main$.com$chilipiper$auth$service$server$Main$$dumpAllThreadStacks(Main.scala:318)
        at app//com.chilipiper.auth.service.server.Main$$anon$2.run(Main.scala:427)
    
  9. djspiewak commented on Jul 8, 2026

    @djspiewak
    Member

    A blocker thread cannot be the owner of a poller, so something is wrong, either with the generated code, or possibly just a race with getting the thread name.

    Also makes me wonder if we have a weird race condition in the interaction between blocker state migration and selector events.

  10. durban commented on Jul 8, 2026

    @durban
    Contributor

    Yes, that seems like a good thing to look at. I tried, and couldn't find anything obvious. (Which, of course, doesn't mean there isn't one...)

  11. durban commented on Jul 9, 2026

    @durban
    Contributor

    There is a problem with new blockers and pollers: #4631. My theory is that that problem is causing this issue, but I can't be sure (details in the PR description). I tried really hard to reproduce this issue based on that theory, but couldn't. I think the way forward now is to make a "temporary" release from the PR branch, and maybe @sideeffffect could test it. (I really should know how to make a release from a branch, but I don't.)

  12. sideeffffect commented on Jul 10, 2026

    @sideeffffect
    Author

    Just let me know the coordinates of a JAR and I'd be happy to deploy it to our production environment.

  13. djspiewak commented on Jul 17, 2026

    @djspiewak
    Member

    @durban Making the release now!

    I really should know how to make a release from a branch, but I don't.

    We definitely should get you all set up with the relevant credentials if we haven't already. You need permissions to publish on the org.typelevel groupId, and a GPG signing key of some sort (rip web of trust…). Sonatype has changed the procedures for the former over the years so I'm not entirely sure what's current, but once you have those two things, you can run sbt release at any time and it'll do the right thing. I recommend running a clean before you do though just to make sure zinc hasn't deceived you.

  14. djspiewak commented on Jul 17, 2026

    @djspiewak
    Member

    @sideeffffect Try 3.7.0-15-0d069d3 when you get a chance!

  15. sideeffffect commented on Jul 18, 2026

    @sideeffffect
    Author
    3.7.0 (baseline):
      trial 0: 1997.5 ms  STRANDED
      trial 1: 2000.2 ms  STRANDED
      trial 2:    0.2 ms  ok
      trial 3: 2000.3 ms  STRANDED
      trial 4: 2000.3 ms  STRANDED
      trial 5:    0.2 ms  ok
      4/6 stalls
    
    3.7.0-15-0d069d3 (PR #4631):
      trial 0: 1998.9 ms  STRANDED
      trial 1: 2000.3 ms  STRANDED
      trial 2: 2000.2 ms  STRANDED
      trial 3:    0.1 ms  ok
      trial 4: 2000.3 ms  STRANDED
      trial 5: 2000.5 ms  STRANDED
      5/6 stalls
    
      Thread dump (trial 0, 600 ms into the 2000 ms hold):
        io-compute-0 [RUNNABLE]
        io-compute-1 [RUNNABLE]
        io-compute-2 [RUNNABLE]
        io-compute-3 [WAITING]         <PARK-SIMPLE: polling NOTHING>
        io-compute-blocker-1 [TIMED_WAITING]  <PARK-SIMPLE: polling NOTHING>
    

    The reproducer uses IO { spinloop } (IO.delay, not IO.blocking), so the #4631 fix (stale _poller on a blocking thread) does not apply here. The idle worker (io-compute-3) still parks without polling any selector while the OP_READ interest sits on one of the spinning workers' selectors.

  16. durban commented on Jul 18, 2026

    @durban
    Contributor

    (@djspiewak I do have the ability to publish on maven central (under my own groupId), so likely just a permission setting is needed for org.typelevel. My maven central username is durban.)

  17. sideeffffect commented on Jul 23, 2026

    @sideeffffect
    Author

    After a few days in Production, we see that 3.7.0-15-0d069d3 did not fix the problem we have:
    all 4 worker threads look like this

    "io-compute-*" RUNNABLE
        sun.nio.ch.EPoll.wait(Native Method)
        sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:121)
        sun.nio.ch.SelectorImpl.select(SelectorImpl.java:142)
        cats.effect.unsafe.SelectorSystem.poll(SelectorSystem.scala:47)
        cats.effect.unsafe.WorkerThread.parkLoopUntilNextSleeper$1(WorkerThread.scala:731)
        cats.effect.unsafe.WorkerThread.park$1(WorkerThread.scala:605)
        cats.effect.unsafe.WorkerThread.lookForWork$1(WorkerThread.scala:475)
        cats.effect.unsafe.WorkerThread.run(WorkerThread.scala:942)
    

    and io-compute-blocker-* threads are parked in SynchronousQueue.poll

    I'm sorry the AI reproducers are of no help 😿 Is there some other way I can be helpful in getting this fixed?

  18. reardonj commented on Jul 24, 2026

    @reardonj
    Contributor

    I'm sorry the AI reproducers are of no help 😿 Is there some other way I can be helpful in getting this fixed?

    Have you been able to reproduce it in an environment where you can hook up a debugger and poke at the state some more?

  19. djspiewak commented on Jul 29, 2026

    @djspiewak
    Member

    Thought about this some more…

    If you're willing to spill some tokens on this problem, I would get a complete heap dump from a production pod where this is happening. Then, hand that dump to an agent together with the Cats Effect sources and tell it to piece together the state of the worker threads, selectors, and polling system. Once it does that, cross-check it carefully, then have it work backwards to form some hypotheses as to what's causing that state to arise.

    This is also probably a reasonable way to distill a minimal reproducer btw, if one exists.

    But you should be able to get all this and then have the agent scrub it of anything which is specific to your application, which ultimately will give you something you can share with us. Intuitively, this feels like a pretty chunky series of sessions. Probably a couple billion tokens from a Sol/Fable class model unless we get lucky and it's something stupid-simple. I wouldn't bother trying it with any of the weaker models.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions