-
Notifications
You must be signed in to change notification settings - Fork 349
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 503 for "soft" failures. #1044
Conversation
bgrozev
commented
Feb 9, 2023
- ref: Move JicofoHealthChecker to kotlin.
- feat: Adapt to jicoco changes, use "soft" failure (503 instead of 500) for MUC and ping timeouts.
…) for MUC and ping timeouts.
} | ||
|
||
private fun performCheck() { | ||
Objects.requireNonNull(focusManager, "FocusManager is not set.") |
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.
This can just be requireNonNull
in Kotlin.
check() | ||
val duration = System.currentTimeMillis() - start | ||
if (duration > HealthConfig.config.maxCheckDuration.toMillis()) { | ||
logger.error("Health check took too long: " + duration + "ms") |
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.
Can use interpolation
if (bridgeSelector.operationalBridgeCount <= 0) { | ||
throw RuntimeException( | ||
"No operational bridges available (total bridge count: " | ||
+ BridgeSelector.bridgeCount.get() + ")") |
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.
Can use interpolation.
throw RuntimeException("Failed to create conference with room name $roomName") | ||
} | ||
} catch (e: Exception) { | ||
throw RuntimeException("Failed to create conference with room name " + roomName + ":" + e.message) |
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.
Can use interpolation.
|
||
// Wait for 5 seconds to receive a response. | ||
if (!pingResponseWait.await(5, TimeUnit.SECONDS)) { | ||
throw RuntimeException("did not receive xmpp ping response for (${xmppProvider.config.name})") |
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.
Why is the name in parentheses?
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #1044 +/- ##
============================================
- Coverage 27.42% 27.33% -0.10%
Complexity 477 477
============================================
Files 124 124
Lines 7416 7437 +21
Branches 1056 1061 +5
============================================
- Hits 2034 2033 -1
- Misses 5130 5149 +19
- Partials 252 255 +3
Continue to review full report at Codecov.
|