-
Notifications
You must be signed in to change notification settings - Fork 40
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
[0.5.x][Blackboard][View] crash on non-pickleable objects in blackboard #108
Comments
I just had a pickle conversation with someone last week and learned of the fragility of pickle. Surprised I hadn't run into this problem myself for so long. In general, I've liked the ability to store classes on the board (saves many lines of extra code) and even taken care to provide accessors that get directly at the attributes (e.g. What have you been doing to workaround the problem? Just not storing the entire object? Things that might be worth doing...
|
To us it's not a problem, because we are never subscribing to blackboard or watching those particular objects. So those objects can sit there (or we redesign the software to reduce the abuse of blackboard) Atleast in 0.5, I'd be favour of just 'skipping' pickling if not pickleable as opposed to adding picklifying helpers cause it adds more things to take care of (folks here have yet to grasp pre/post tick, visitors etc) and many classes would be picklifyable (so I think we can skip those keys which are not pickle-able when dumping, somethink like:
|
Subtracting them does potentially mean you'll miss updates because they won't be in the check for changes in the blackboard. To check on adding I'd have to re-implement How about just checking for a pickle error on dumping in v0.5, send a throttled warning and publish regardless. This will have the downside of suboptimal publishing even when there isn't change, but at least you won't miss changes. Once people see the warning, they can aim to be more frugal in dumping only certain attributes of the problem object on the board rather than the unpicklable whole. I'll work on a better solution in v1.3. |
I am interested in a solution for this as well, need to stick with 0.5 because we are using Melodic. There is some information out there about this problem but you need to recursively check all the objects which could be slow. In my case it is an array of ros messages that it can't handle. |
Releasing in |
When publishing the
blackboard
or watching non-pickleable objects throughpy-trees-blackboard-watcher
, the tree would crash. This is because of exception in dumps.example:
One some other objects it's raising
cPickle.PicklingError
.It might not be a good practice to put classes in the blackboard but in our code base, few of them are there and this happened when somebody hit
rostopic echo /tree/blackboard
(actually it wasrosbag record --all
)In the
devel
version, I seepickle
being used instead ofcPickle
, but it seems to have the same problem.The text was updated successfully, but these errors were encountered: