Skip to content

Commit

Permalink
log: Log if endpoints count becomes negative.
Browse files Browse the repository at this point in the history
  • Loading branch information
bgrozev committed Feb 12, 2025
1 parent 2d64468 commit f825ce9
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,10 @@ class Bridge @JvmOverloads internal constructor(
fun endpointRemoved() = endpointsRemoved(1)
fun endpointsRemoved(count: Int) {
endpoints.addAndGet(-count)
if (endpoints.get() < 0) {
logger.error("Removed more endpoints than were allocated. Resetting to 0.", Throwable())
endpoints.set(0)
}
}
fun endpointRequestedRestart() {
endpointRestartRequestRate.update(1)
Expand Down

0 comments on commit f825ce9

Please sign in to comment.