leshan: Better handle unexpected error in DefaultRegistrationEngine.
Hello,
If the procedure inside of ClientInitiatedBootstrapTask, UpdateRegistrationTask, and/or RegistrationTask raises an unexpected exception, that exception caught by a catch clause and it logs that, but that task never works after caught and unfortunately the process still alive.
For example, if registerWithRetry() that is in RegistrationTask#run() raises a RuntimeException, that task never scheduled anymore (i.e. that process does nothing).
This behavior makes it a little bit hard to implement a robust LwM2M client. I think it would be better to provide a way to exit when it falls into an unexpected situation.
What do you think about this?
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 21 (21 by maintainers)
Commits related to this issue
- Move the classes `Destroyable`, `Startable` and `Stoppable` to leshan-core package Ref: https://github.com/eclipse/leshan/issues/933#issuecomment-731036021 Signed-off-by: moznion <moznion@gmail.com> — committed to moznion/leshan by moznion 4 years ago
- Move the interfaces to manage the state to leshan-core package Move the interfaces `Destroyable`, `Startable` and `Stoppable` to `leshan-core` package from `leshan-server-core`. This commit aims to u... — committed to moznion/leshan by moznion 4 years ago
- #933: Move the interfaces to manage the state to leshan-core package Move the interfaces `Destroyable`, `Startable` and `Stoppable` to `leshan-core` package from `leshan-server-core`. This commit aim... — committed to eclipse-leshan/leshan by moznion 4 years ago
- #933: Call management method for each LwM2mObjectEnabler on LeshanClient Now it calls `destroy()`, `stop()` and `start()` for each LwM2mObjectEnabler instance according to the LeshanClient status. Fo... — committed to eclipse-leshan/leshan by moznion 4 years ago
- #933: Add method: `onUnexpectedErrorOccurred()` for LwM2mClientObserver Add an interface method `void onUnexpectedErrorOccurred(Throwable unexpectedError)` into LwM2mClientObserver. This aims to hook... — committed to moznion/leshan by moznion 4 years ago
- #933: Handle unexpected errors on `DefaultRegistrationEngine` Call `LwM2mClientObserver#onUnexpectedErrorOccurred()` on `DefaultRegistrationEngine` when it raises `RuntimeException` at task loop. Si... — committed to moznion/leshan by moznion 4 years ago
- #933: Add demo code to shutdown when an unexpected error has occurred Signed-off-by: moznion <moznion@gmail.com> — committed to moznion/leshan by moznion 4 years ago
- #933: Rename: s/onUnexpectedErrorOccurred/onUnexpectedError/g Signed-off-by: moznion <moznion@gmail.com> — committed to moznion/leshan by moznion 4 years ago
- #933: Implement Destroyable, Startable and Stoppable on ObjectEnabler To call `LwM2mInstanceEnabler#stop()`, `LwM2mInstanceEnabler#start()` and `LwM2mInstanceEnabler#destroy()` on the associated meth... — committed to moznion/leshan by moznion 4 years ago
- #933: register ShutdownOnUnexpectedErrorObserver for LeshanClient Instead of on `LeshanClientDemo` Signed-off-by: moznion <moznion@gmail.com> — committed to moznion/leshan by moznion 4 years ago
- #933: format code Signed-off-by: moznion <moznion@gmail.com> — committed to moznion/leshan by moznion 4 years ago
- #933: Add method: `onUnexpectedError()` for LwM2mClientObserver Add an interface method `void onUnexpectedError(Throwable unexpectedError)` into LwM2mClientObserver. This aims to hook a procedure whe... — committed to eclipse-leshan/leshan by moznion 4 years ago
- #933: Handle unexpected errors on `DefaultRegistrationEngine` Call `LwM2mClientObserver#onUnexpectedError()` on `DefaultRegistrationEngine` when it raises `RuntimeException` at task loop. Signed-off... — committed to eclipse-leshan/leshan by moznion 4 years ago
- #933: Implement Destroyable, Startable and Stoppable on ObjectEnabler To call `LwM2mInstanceEnabler#stop()`, `LwM2mInstanceEnabler#start()` and `LwM2mInstanceEnabler#destroy()` on the associated meth... — committed to eclipse-leshan/leshan by moznion 4 years ago
- #933: destroy LeshanClient on unexpected error. Signed-off-by: moznion <moznion@gmail.com> Also-by: Simon Bernard <sbernard@sierrawireless.com> — committed to eclipse-leshan/leshan by moznion 4 years ago
- #933: Add new interfaces to core: Destroyable, Startable and Stoppable Signed-off-by: moznion <moznion@gmail.com> — committed to moznion/leshan by moznion 4 years ago
- #933: Mark as deprecated for server.(Destroyable, Startable, Stoppable) And make a suggestion to use interfaces that are in the `core` package. Signed-off-by: moznion <moznion@gmail.com> — committed to moznion/leshan by moznion 4 years ago
- #933: Implement Destroyable, Startable and Stoppable for ObjectEnabler To call each interface method on corresponded `LwM2mObjectTree` method. Signed-off-by: moznion <moznion@gmail.com> — committed to moznion/leshan by moznion 4 years ago
- #933: Implement Destroyable, Startable and Stoppable for LwM2mObjectTree And call each interface's method at related method of `LeshanClient`; i.e. `start()`, `stop()` and `destroy()`. Signed-off-b... — committed to moznion/leshan by moznion 4 years ago
- #933: Add an interface `LwM2mClientObserver2` to handle unexpected erorr This interface extends `LwM2mClientObserver` interface. And make `LwM2mClientObserverAdapter` and `LwM2mClientObserverDispatch... — committed to moznion/leshan by moznion 4 years ago
In my understanding, I finished my work on the
masterbranch.Yeah, I’d like to backport those features to the
1.xproject (actually this is just what I needed 😄 ). I’m going to try that according to your suggestion.