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
nidaqmx.proto supports the DAQmxGetExtendedErrorInfo function. Calling this function via gRPC is not reliable because it uses thread-local storage.
Depending which server thread is used to handle this request, it may return the correct error message, an empty string, or an incorrect error message.
Steps to reproduce:
Change one of the DAQmx examples to make multiple concurrent GetExtendedErrorInfo requests:
def raise_if_error(response):
"""Raise an exception if an error was returned."""
if response.status != 0:
response = client.GetExtendedErrorInfo.future(nidaqmx_types.GetExtendedErrorInfoRequest())
response2 = client.GetExtendedErrorInfo.future(nidaqmx_types.GetExtendedErrorInfoRequest())
response3 = client.GetExtendedErrorInfo.future(nidaqmx_types.GetExtendedErrorInfoRequest())
raise Exception(f"Error: {response3.result().error_string}")
Run NI IO Trace and enable the ThreadID column.
Run the example with an invalid device identifier. Normally, this would display a "Device identifier is invalid" error, but this issue may cause it to display an empty string or an incorrect error message.
(.venv) PS Z:\grpc-device\examples\nidaqmx> python .\analog-input.py localhost 31763 Dev42/ai0
Traceback (most recent call last):
File ".\analog-input.py", line 71, in <module>
raise_if_error(
File ".\analog-input.py", line 63, in raise_if_error
raise Exception(f"Error: {response3.result().error_string}")
Exception: Error: The requested memory could not be allocated.
Status Code: -50352
NI IO Trace will show which thread was used to handle each call to DAQmxGetExtendedErrorInfo:
I validated that GetExtendedErrorInfo has been removed from nidaqmx.proto and is called from NiDAQmxService::ConvertApiErrorStatusForTaskHandle, which should always be called on the same thread that returned the error.
nidaqmx.proto supports the
DAQmxGetExtendedErrorInfo
function. Calling this function via gRPC is not reliable because it uses thread-local storage.Depending which server thread is used to handle this request, it may return the correct error message, an empty string, or an incorrect error message.
Steps to reproduce:
NI IO Trace will show which thread was used to handle each call to
DAQmxGetExtendedErrorInfo
:AB#2085088
The text was updated successfully, but these errors were encountered: