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
Description
Rclnodejs execute function is triggering the client processResponse without having sent a request. This generates a new Error which is thrown and makes my server crash.
In order to debug it, we added the following logs inside rclnodejs: lib/client.js
/** * Send the request and will be notified asynchronously if receiving the repsonse. * @param {object} request - The request to be submitted. * @param {ResponseCallback} callback - Thc callback function for receiving the server response. * @return {undefined} * @see {@link ResponseCallback} */sendRequest(request,callback){letrequestToSend=requestinstanceofthis._typeClass.Request
? request
: newthis._typeClass.Request(request);if(typeofcallback!=='function'){thrownewTypeError('Invalid argument');}letrawRequest=requestToSend.serialize();letsequenceNumber=rclnodejs.sendRequest(this._handle,rawRequest);console.log("RCL ----------- SENDING REQUEST:",this._serviceName,sequenceNumber);debug(`Client has sent a ${this._serviceName} request.`);this._sequenceNumberToCallbackMap.set(sequenceNumber,callback);}processResponse(sequenceNumber,response){console.log("RCL ----------- PROCESSING RESPONSE:",this._serviceName,sequenceNumber);if(this._sequenceNumberToCallbackMap.has(sequenceNumber)){debug(`Client has received ${this._serviceName} response from service.`);letcallback=this._sequenceNumberToCallbackMap.get(sequenceNumber);this._sequenceNumberToCallbackMap.delete(sequenceNumber);callback(response.toPlainObject(this.typedArrayEnabled));}else{thrownewError(`Client has received an unexpected ${this._serviceName} with sequence number ${sequenceNumber}.`);}}
Currently we do not have a simple way to reproduce this bug.
We are using clients to connect to the /${node}/describe_parameters same for get_parameters, list_parameters and set_parameters in order to retrieve them on our HMI.
We did a ros2 topic echo /parameter_events but this final response is triggered without any parameter change.
Expected Behavior
Rclnodejs should ignore the response if there is no associated request.
Also, rclnodejs should implement a way to catch this kind of errors.
Actual Behavior
Rclnodejs crashes and this error is propagated to the server.
The text was updated successfully, but these errors were encountered:
Hi @PierreSachot I'm busy preparing the release for latest ROS2 Jazzy, I saw you already had a deep investigation to identify the root cause, please feel free to open a PR to fix it, I will also touch on it when I have some free time, thanks!
Description
Rclnodejs execute function is triggering the client processResponse without having sent a request. This generates a new Error which is thrown and makes my server crash.
In order to debug it, we added the following logs inside rclnodejs:
lib/client.js
and here are the outputs:
Steps To Reproduce
Currently we do not have a simple way to reproduce this bug.
We are using clients to connect to the
/${node}/describe_parameters
same forget_parameters
,list_parameters
andset_parameters
in order to retrieve them on our HMI.We did a
ros2 topic echo /parameter_events
but this final response is triggered without any parameter change.Expected Behavior
Rclnodejs should ignore the response if there is no associated request.
Also, rclnodejs should implement a way to catch this kind of errors.
Actual Behavior
Rclnodejs crashes and this error is propagated to the server.
The text was updated successfully, but these errors were encountered: