Avoid 'Intra process message no longer being stored when trying to ha… (#749)

Signed-off-by: ivanpauno <ivanpauno@ekumenlabs.com>
This commit is contained in:
ivanpauno 2019-05-30 15:54:02 -03:00 committed by GitHub
parent 347f8d0b1d
commit 8ff51833ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -178,10 +178,11 @@ public:
intra_process_subscription_id_, intra_process_subscription_id_,
msg); msg);
if (!msg) { if (!msg) {
// This either occurred because the publisher no longer exists or the // This can happen when having two nodes in different process both using intraprocess
// message requested is no longer being stored. // communication. It could happen too if the publisher no longer exists or the requested
RCLCPP_WARN(get_logger("rclcpp"), // message is not longer being stored.
"Intra process message no longer being stored when trying to handle it"); // TODO(ivanpauno): Print a warn message in the last two cases described above,
// but not in the first one.
return; return;
} }
any_callback_.dispatch_intra_process(msg, message_info); any_callback_.dispatch_intra_process(msg, message_info);
@ -193,10 +194,11 @@ public:
intra_process_subscription_id_, intra_process_subscription_id_,
msg); msg);
if (!msg) { if (!msg) {
// This either occurred because the publisher no longer exists or the // This can happen when having two nodes in different process both using intraprocess
// message requested is no longer being stored. // communication. It could happen too if the publisher no longer exists or the requested
RCLCPP_WARN(get_logger("rclcpp"), // message is not longer being stored.
"Intra process message no longer being stored when trying to handle it"); // TODO(ivanpauno): Print a warn message in the last two cases described above,
// but not in the first one.
return; return;
} }
any_callback_.dispatch_intra_process(std::move(msg), message_info); any_callback_.dispatch_intra_process(std::move(msg), message_info);