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

'badarg' thrown in ETS update #73

Open
GalaxyGorilla opened this issue Apr 29, 2016 · 2 comments
Open

'badarg' thrown in ETS update #73

GalaxyGorilla opened this issue Apr 29, 2016 · 2 comments

Comments

@GalaxyGorilla
Copy link

GalaxyGorilla commented Apr 29, 2016

Hi!

I have a problem with counter updates which very seldom appears. An error is thrown with the following 'reason':

{error, badarg, [{ets, update_counter, [exometer_2, [some, exometer, id], {8,1}], []}

Unfortunately I am not able to reproduce this, it seems to be a very tricky race condition. However, I was curious how this could even happen within exometer. The error happens HERE. So the internal ID lookup works but the following ETS update call seems to raise an error for whatever reason. For me it looks like such a call to the ETS table should never crash when the previous lookup is successful.

I am very grateful for any hints that I might try on my code.

@uwiger
Copy link
Member

uwiger commented Apr 29, 2016

It's baffling. The update_counter/3 call could fail if (a) the attribute value isn't an integer, or (b) the record is suddenly deleted (after having existed for the lookup). I don't really see how (a) could happen, at least through the exometer_core API, and (b) is of course possible in theory.

@GalaxyGorilla
Copy link
Author

@uwiger: I can now frequently generate this error within a larger test suite. I will come back with a better error description when I find the time.

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

2 participants