Improve “upstream is not available” error to better understand what happened (#482)
* exclude Mono.empty() and write FullCause to response * add test Lower matcher type (#72)
This commit is contained in:
@@ -229,7 +229,7 @@ class QuorumRequestReader(
|
||||
private fun noResponse(method: String, q: CallQuorum): Mono<Result> {
|
||||
return apiControl.upstreamsMatchesResponse()?.run {
|
||||
tracer.currentSpan()?.tag(SPAN_NO_RESPONSE_MESSAGE, getFullCause())
|
||||
val cause = getCause(method) ?: return Mono.empty()
|
||||
val cause = getCause(method) ?: return Mono.error(RpcException(1, "No response for method $method", getFullCause()))
|
||||
if (cause.shouldReturnNull) {
|
||||
Mono.just(
|
||||
Result(Global.nullValue, null, 1, null, null),
|
||||
|
||||
@@ -27,9 +27,9 @@ class UpstreamsMatchesResponse {
|
||||
}
|
||||
}
|
||||
|
||||
fun getFullCause(): String? =
|
||||
fun getFullCause() =
|
||||
if (responses.isEmpty()) {
|
||||
null
|
||||
"Response is empty"
|
||||
} else {
|
||||
responses
|
||||
.joinToString("; ") { "${it.upstreamId} - ${it.matchesResponse.getCause()}" }
|
||||
|
||||
Reference in New Issue
Block a user