OpenTSDB / tcollector

Data collection framework for OpenTSDB
http://opentsdb.net
GNU Lesser General Public License v3.0
513 stars 359 forks source link

Fix dictionary element deletion error in python3 #456

Closed sumanshil closed 6 months ago

sumanshil commented 3 years ago

In python3 we get this exception

Traceback (most recent call last): File "/opt/tcollector/tcollector.py", line 375, in run col.evict_old_keys(now) File "/opt/tcollector/tcollector.py", line 276, in evict_old_keys for key in self.values.keys(): RuntimeError: dictionary changed size during iteration 2021-01-23 16:54:56,333 tcollector[20919] INFO: Reading from processstats.py

This issue is discussed here.

https://stackoverflow.com/questions/11941817/how-to-avoid-runtimeerror-dictionary-changed-size-during-iteration-error

Please review the changes.

sumanshil commented 3 years ago

Can someone please review the changes?

sumanshil commented 3 years ago

@Elfe Can you please merge the diff? I don't have write access.

sumanshil commented 3 years ago

@Elfe Thanks for approving the diff.

vasiliyk commented 6 months ago

Gentlemen, thank you for contributing!