8000 Reloadable buffer pools by vigoo · Pull Request #6447 · zio/zio · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 4 commits into from
Mar 18, 2022
Merged

Reloadable buffer pools #6447

merged 4 commits into from
Mar 18, 2022

Conversation

vigoo
Copy link
Contributor
@vigoo vigoo commented Mar 18, 2022

No description provided.

@vigoo vigoo requested a review from jdegoes March 18, 2022 15:19
_ <- threadsStartedTotal.launch(schedule.updateMetrics)
_ <- threadsDeadlocked.launch(schedule.updateMetrics)
_ <- threadsDeadlockedMonitor.launch(schedule.updateMetrics)
_ <- ZIO.acquireRelease(refreshThreadStateCounts(threadMXBean).repeat(schedule.updateMetrics).forkDaemon)(
Copy link
Member

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.

Copy link
Member
@jdegoes jdegoes left a 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],
Copy link
Member

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.:

Suggested change
updateMetrics: Schedule[Any, Any, Unit],
updateMetrics: Schedule[Any, Any, Any],

etc.

jdegoes
jdegoes previously approved these changes Mar 18, 2022
jdegoes
jdegoes previously approved these changes Mar 18, 2022
@@ -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]] =
Copy link
Member

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.

@vigoo vigoo merged commit 7e5d7df into zio:series/2.x Mar 18, 2022
@vigoo vigoo deleted the issue-6434-3 branch March 18, 2022 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0