driplineorg / dripline-cpp

C++ Implementation of the Dripline framework
http://driplineorg.github.io
Apache License 2.0
1 stars 0 forks source link

RuntimeError: dictionary changed size during iteration #72

Closed raphaelcervantes closed 3 years ago

raphaelcervantes commented 3 years ago

https://github.com/driplineorg/dripline-cpp/blob/f803a329b532ff21ec11a3ebea4dc47b49d38fa6/library/receiver.cc#L399

While trying to use postgres_sensor_logger.py to insert my payload into a database, I run into this error:


2021-01-09 02:07:32 [ERROR] (tid 140142858069760) rary/receiver.cc(399): Exception caught; shutting down.
    RuntimeError: dictionary changed size during iteration

I believe it is because the payload dictionary does not match the table structure.

I thought this issue was fixed in this pull request: https://github.com/driplineorg/dripline-python/pull/101 but now I see the error message pointing to dripline-cpp.

I think there dripline-cpp should handle this case more gracefully. Or it should implement the same solution as the python-pull request where you iterate over a copy of the list of kwargs so that you aren't iterating over a changing list.

raphaelcervantes commented 3 years ago

Actually, this might be fine. I didn't realize this particular logger was using dripline-python 4.4.2. This might not have implemented the relevant pull request yet.

raphaelcervantes commented 3 years ago

I don't think this is an issue. I'm going to close this ticket.