Kong / lua-resty-counter

Lock-free counter for OpenResty
22 stars 11 forks source link

fix(counter) standard behavior on failures #4

Closed locao closed 4 years ago

fffonion commented 4 years ago

(Note: from https://github.com/Kong/kong/issues/6160) @locao this should have same behaviour if we return nil, err here, there'll be error() either from this library or prometheus itself. So I suspect this won't be the case for the kong issue.

locao commented 4 years ago

we usually error out on cases like this, since they usually indicates errors during coding rather than runtime errors.

@fffonion Got it, thanks!

this should have same behaviour if we return nil, err here, there'll be error() either from this library or prometheus itself.

I agree, I made this change because the plugin is expecting to receive nil, err on failures.