Disable multi-request on unknown errors (#1027)

Another P100 fix
This commit is contained in:
Steven B 2024-07-01 14:33:28 +01:00 committed by GitHub
parent 8d1a4a4229
commit 03f72b8be0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -154,10 +154,14 @@ class SmartProtocol(BaseProtocol):
try: try:
self._handle_response_error_code(response_step, batch_name) self._handle_response_error_code(response_step, batch_name)
except DeviceError as ex: except DeviceError as ex:
# P100 sometimes raises JSON_DECODE_FAIL_ERROR on batched request so # P100 sometimes raises JSON_DECODE_FAIL_ERROR or INTERNAL_UNKNOWN_ERROR
# disable batching # on batched request so disable batching
if ( if (
ex.error_code is SmartErrorCode.JSON_DECODE_FAIL_ERROR ex.error_code
in {
SmartErrorCode.JSON_DECODE_FAIL_ERROR,
SmartErrorCode.INTERNAL_UNKNOWN_ERROR,
}
and self._multi_request_batch_size != 1 and self._multi_request_batch_size != 1
): ):
self._multi_request_batch_size = 1 self._multi_request_batch_size = 1