-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Reloadable buffer pools #6447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -2040,7 +2040,7 @@ sealed trait ZIO[-R, +E, +A] extends Serializable with ZIOPlatformSpecific[R, E, | |||
*/ | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can delete the type parameter B
and use Any
for that slot in Schedule
.
No description provided.