Skip to content
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

Use Clock#realTime for Open#startedAt #253

Merged
merged 1 commit into from
Apr 12, 2023

Conversation

peterneyens
Copy link
Contributor

I was trying to debug an issue where a circuit breaker appeared to be stuck open and got confused by the started timestamp.

The documentation says:

startedAt is the timestamp in milliseconds since the epoch when the transition to Open happened

But with monotonic / System.nanoTime() we get an arbitrary duration.

The Timestamp comment also says:

Type-alias to document timestamps specified in milliseconds, as returned by Clock.realTime

@peterneyens
Copy link
Contributor Author

In CircuitBreaker#of we could use cachedRealTime by passing the F[FiniteDuration] to SyncCircuitBreaker, but we can't do that in CircuitBreaker#in (we would need F[G[FiniteDuration]].

@ChristopherDavenport ChristopherDavenport merged commit 4f8f629 into davenverse:main Apr 12, 2023
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