mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
Blacklist ubus object only in timed out
This commit is contained in:
parent
25e2d0bab6
commit
ad2602f114
1 changed files with 6 additions and 11 deletions
|
|
@ -236,13 +236,6 @@ static int __dm_ubus_call_sync_entry(struct dm_ubus_cache_entry *entry, const ch
|
||||||
|
|
||||||
if (ubus_lookup_id(ubus_ctx, obj, &id)) {
|
if (ubus_lookup_id(ubus_ctx, obj, &id)) {
|
||||||
BBF_WARNING("Failed to lookup UBUS object ID for '%s' using method '%s'", obj, method);
|
BBF_WARNING("Failed to lookup UBUS object ID for '%s' using method '%s'", obj, method);
|
||||||
|
|
||||||
entry->consecutive_timeouts++;
|
|
||||||
if (entry->consecutive_timeouts >= UBUS_MAX_CONSECUTIVE_TIMEOUTS) {
|
|
||||||
entry->is_blacklisted = true;
|
|
||||||
BBF_ERR("UBUS [object: %s, method: %s] has been blacklisted due to repeated timeouts", obj, method);
|
|
||||||
}
|
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -253,11 +246,13 @@ static int __dm_ubus_call_sync_entry(struct dm_ubus_cache_entry *entry, const ch
|
||||||
BBF_ERR("UBUS invoke failed [object: %s, method: %s, timeout: %d ms] with error (%s:%d)",
|
BBF_ERR("UBUS invoke failed [object: %s, method: %s, timeout: %d ms] with error (%s:%d)",
|
||||||
obj, method, timeout, err_msg, err);
|
obj, method, timeout, err_msg, err);
|
||||||
|
|
||||||
|
if (err == UBUS_STATUS_TIMEOUT) {
|
||||||
entry->consecutive_timeouts++;
|
entry->consecutive_timeouts++;
|
||||||
if (entry->consecutive_timeouts >= UBUS_MAX_CONSECUTIVE_TIMEOUTS) {
|
if (entry->consecutive_timeouts >= UBUS_MAX_CONSECUTIVE_TIMEOUTS) {
|
||||||
entry->is_blacklisted = true;
|
entry->is_blacklisted = true;
|
||||||
BBF_ERR("UBUS [object: %s, method: %s] has been blacklisted due to repeated timeouts", obj, method);
|
BBF_ERR("UBUS [object: %s, method: %s] has been blacklisted due to repeated timeouts", obj, method);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
entry->consecutive_timeouts = 0;
|
entry->consecutive_timeouts = 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue