-
Notifications
You must be signed in to change notification settings - Fork 407
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
error log level on nominal use case ? #1634
Comments
Agree with that.
I don't know if this is really a "nominal use case" This is a case where we get a notification which was accepted by coap layer but when we search the corresponding observation at LWM2M level we didn't find it. So theoretically, this should be more about race condition than a wrong token used but this should not be so easy to trigger for a device or maybe there is a bug on how we handle this ? Is it something you face often ? did you identifier clearly what trigger this ?
I understand your point. |
You're right, I missed that the Coap layer did validate the token beforehand.
Not often, a few times last month.
On our prod this log happened in 2 different race condition use cases :
In our log policy, we do not raise WARN on expected race conditions, but it can clearly be discussed. Anyway it seems better than ERROR. In that case we would just change the log level trigger for this class. |
I think in both case, there is something not so good as client side. Don't you think ? First, client doesn't to the registration update in time. (it should do that several minutes before the lifetime expired)
ERROR is clearly too high. Currently we haven't really clear guideline for log level usage, see https://github.com/eclipse-leshan/leshan/wiki/Code-&-design-guidelines#code-rules Maybe the project need something better than that, If you (Orange) could contribute/help to create together a clear Log Level policy for Leshan ? |
Yes. But race conditions are often tricky to target as implementation error. The client can send its notify with its lifetime still OK, but the the network and SSL handshake can take some time so as the lifetime is now over. The stackoverfkow thread you mentioned highlight the ambiguity :
this definition clearly goes with the WARN choice in our case
this definition goes more with the INFO choice in our case. It is consistent with this blog post for instance : https://betterstack.com/community/guides/logging/log-levels-explained/ Clearly, in our project we set with this second definition : WARN logs and above will trigger some human analysis. And I don't want to check what happened every time this race condition occurs 😅. But if you choose this definition, it means that most libraries should have very few WARN logs; it is usually up to the application level to know there is something unexpected that a human should oversee... |
I agree but a client should take this into account so this should happens very very rarely. leshan/leshan-lwm2m-client/src/main/java/org/eclipse/leshan/client/EndpointsManager.java Lines 46 to 55 in b05c759
|
Once I finish what I'm working on I will move this log to WARN. Then if wanted, we can try to create a log level usage policy together and then adapt it again (maybe to INFO if needed) |
Thanks, LGTM. |
Done in 3d03a8e
I created a dedicated issue about that : #1641 I close this issue but feel free to reopen or comment if needed. |
In production we did encounter this log :
leshan/leshan-tl-cf-server-coap/src/main/java/org/eclipse/leshan/transport/californium/server/endpoint/CaliforniumServerEndpointsProvider.java
Line 159 in b05c759
It seems that this can be a nominal use case when lwm2m client uses wrong token or in case of race condition on removing Observation.
ERROR log level is usually a trigger for operators as a service malfunction, which is not necessary the case here, and should not be used on a potential nominal use case.
I think it should be decreased to INFO level.
What do you think ?
The text was updated successfully, but these errors were encountered: