Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't log full message on serialization errors? #148

Open
stwirth opened this issue Dec 21, 2022 · 0 comments
Open

Don't log full message on serialization errors? #148

stwirth opened this issue Dec 21, 2022 · 0 comments

Comments

@stwirth
Copy link

stwirth commented Dec 21, 2022

We recently had a bug in a python script which made the serialization of a sensor_msgs/Image fail. The result was that the full image was logged to rosout, making the logs grow by multiple megabytes per second.

  File "/[...]/python3.8/site-packages/genpy/message.py", line 385, in _check_types
    raise SerializationError(str(exc))
genpy.message.SerializationError: <class 'TypeError'>: 'string argument expected, got 'bytes'' when writing 'header: 
  seq: 234328
  stamp: 
    secs: 1670536260
    nsecs: 942930698
  frame_id: "camera_down_infra1_frame"
height: 240
width: 320
encoding: "mono8"
is_bigendian: 0
step: 320
data: [4, 3, 3, 4, 3, 4, 3, 4, 4, 4, 3, 3, 4, 3, 3, 3, 3, 4, 3, 3, 3, 3, 3, 4, 3, 3, 4, 3, 3, 3, 3, 4, 3, 4, 3, 4, 3, 3, 3, 3, 3, 3, 4, 4, 3, 3, 4, 3, 4, 3, 3, 3, 3, 3, 4, 4, 3, 3, 4, 3, 3, 3, 4, 4, 3, 3, 4, 4, 3, 4, 3, 3, 3, 3, 3, 3, 4, 3, 4, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 3, 4, 4, 4, 4, 4, ...

This is bad for log management and also bad for SSDs.

I'd like to have the option to not log full messages to rosout on serialization errors.
Alternatively, the logging module in rospy could be changed to be able to enforce a maximum log message size.
What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant