Repository navigation
Reloadable buffer pools - #6447
Conversation
| _ <- threadsStartedTotal.launch(schedule.updateMetrics) | ||
| _ <- threadsDeadlocked.launch(schedule.updateMetrics) | ||
| _ <- threadsDeadlockedMonitor.launch(schedule.updateMetrics) | ||
| _ <- ZIO.acquireRelease(refreshThreadStateCounts(threadMXBean).repeat(schedule.updateMetrics).forkDaemon)( |
There was a problem hiding this comment.
Should this be:
ZIO.acquireRelease(ZIO.interruptibly(refreshThreadStateCounts(threadMXBean).repeat(schedule.updateMetrics).)forkDaemon)(Otherwise it will hang shutdown because it can't be interrupted. Please make this change for all the other ZIO.acquireRelease ones.
Also, maybe we are missing something to accomplish this?
e.g. .scheduleBackground which could return ZIO[Scope, ...] and handle this messy part.
There was a problem hiding this comment.
Looks really good! I have have one comment on ZIO.acquireRelease hanging the finalizers because the acquire action is not interruptible.
| * metrics | ||
| */ | ||
| final case class JvmMetricsSchedule( | ||
| updateMetrics: Schedule[Any, Any, Unit], |
There was a problem hiding this comment.
Let's change the return type of these two schedules to Any, e.g.:
| updateMetrics: Schedule[Any, Any, Unit], | |
| updateMetrics: Schedule[Any, Any, Any], |
etc.
| final def scheduleBackground[R1 <: R, B](schedule: => Schedule[R1, Any, B])(implicit | ||
| trace: ZTraceElement | ||
| ): ZIO[R1 with Clock with Scope, E, B] = | ||
| ): ZIO[R1 with Clock with Scope, E, Fiber[Any, B]] = |
There was a problem hiding this comment.
You can delete the type parameter B and use Any for that slot in Schedule.
No description provided.