You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is no way to get error status on SAS request for blob upload.
So when we call IoTHubDeviceClient_UploadMultipleBlocksToBlobAsync, it invokes the following chain:
IoTHubDeviceClient_UploadMultipleBlocksToBlobAsync
IoTHubClientCore_UploadMultipleBlocksToBlobAsync
startHttpWorkerThread
ThreadAPI_Create [here we lose error returned by uploadMultipleBlock_thread]
uploadMultipleBlock_thread [int, IOTHUB_CLIENT_ERROR]
IoTHubClientCore_LL_UploadMultipleBlocksToBlobEx [IOTHUB_CLIENT_RESULT, IOTHUB_CLIENT_ERROR]
IoTHubClient_LL_UploadToBlob_InitializeUpload [IOTHUB_CLIENT_RESULT, IOTHUB_CLIENT_ERROR]
IoTHubClient_LL_UploadToBlob_GetBlobCredentialsFromIoTHub [int, MU_FAILURE]
send_http_sas_request [int, MU_FAILURE]
HTTPAPIEX_SAS_ExecuteRequest
SAS request is asynchronous, so we cannot get result immediately. And we never call IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_CALLBACK_EX with this error.
So right now the calling routine waits forever.
Moreover even synchronous call doesn't return an error because invocation of ThreadAPI_Join (that returns exit code of a thread function) just passes unused variable for return code, e.g. in the following chain.
IoTHubDeviceClient_Destroy
IoTHubClientCore_Destroy
Seems like the best way to inform the caller routine about the error is to invocate IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_CALLBACK_EX (and IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_CALLBACK)
function and pass the error through IOTHUB_CLIENT_FILE_UPLOAD_RESULT result parameter.
The text was updated successfully, but these errors were encountered:
In summary, we are trapping both the return code from IoTHubClientCore_LL_UploadMultipleBlocksToBlobEx and callback result (if invoked) and firing the IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_CALLBACK_EX from uploadMultipleBlock_thread after calling IoTHubClientCore_LL_UploadMultipleBlocksToBlobEx with the composite result. Would you be able to validate this branch as well before we move to merge it?
Development Machine, OS, Compiler (and Other Relevant Toolchain Info)
Ubuntu 22.04.1 LTS
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
SDK Version
1.11.0
Commit SHA: 97fef57
Release 2023-08-07
Protocol
MQTT
Describe the Bug
There is no way to get error status on SAS request for blob upload.
So when we call IoTHubDeviceClient_UploadMultipleBlocksToBlobAsync, it invokes the following chain:
IoTHubDeviceClient_UploadMultipleBlocksToBlobAsync
IoTHubClientCore_UploadMultipleBlocksToBlobAsync
startHttpWorkerThread
ThreadAPI_Create [here we lose error returned by uploadMultipleBlock_thread]
uploadMultipleBlock_thread [int, IOTHUB_CLIENT_ERROR]
IoTHubClientCore_LL_UploadMultipleBlocksToBlobEx [IOTHUB_CLIENT_RESULT, IOTHUB_CLIENT_ERROR]
IoTHubClient_LL_UploadToBlob_InitializeUpload [IOTHUB_CLIENT_RESULT, IOTHUB_CLIENT_ERROR]
IoTHubClient_LL_UploadToBlob_GetBlobCredentialsFromIoTHub [int, MU_FAILURE]
send_http_sas_request [int, MU_FAILURE]
HTTPAPIEX_SAS_ExecuteRequest
SAS request is asynchronous, so we cannot get result immediately. And we never call IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_CALLBACK_EX with this error.
So right now the calling routine waits forever.
Moreover even synchronous call doesn't return an error because invocation of ThreadAPI_Join (that returns exit code of a thread function) just passes unused variable for return code, e.g. in the following chain.
IoTHubDeviceClient_Destroy
IoTHubClientCore_Destroy
Seems like the best way to inform the caller routine about the error is to invocate IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_CALLBACK_EX (and IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_CALLBACK)
function and pass the error through IOTHUB_CLIENT_FILE_UPLOAD_RESULT result parameter.
The text was updated successfully, but these errors were encountered: