Skip to content
This repository has been archived by the owner on Oct 31, 2020. It is now read-only.

Fix for occasional crash due to data updating #425

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

drasmuss
Copy link
Member

Javaviz will randomly crash every once in a while, if data happens to get updated during this function. I just followed the previous solution of ignoring the error, since we'll be getting plenty more data.

@@ -42,11 +42,11 @@ def add_data(self, id, time, data):
try:
if len(self.data) > 0 and self.data[0][1] > time:
del self.data[:]
except IndexError:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would a better solution be to put some kind of semaphore around the data access bits?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be a better solution, but I think it would be pretty complicated to get working (with the mix of java, python, servers, etc.). And since it doesn't really matter if we drop one packet every once in a while (this error is quite rare), I think the slacker solution is OK.

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

Successfully merging this pull request may close these issues.

2 participants