-
Notifications
You must be signed in to change notification settings - Fork 118
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
MappingWatcher should not close when mapper throws exception #995
Comments
I agree the behavior is confusing and we probably want to align the behavior from the two implementations. Just so I'm not missing anything, @minwoox do you know why |
Hi, @cormoran centraldogma/client/java/src/main/java/com/linecorp/centraldogma/client/FileWatcher.java Lines 62 to 63 in e93bc5a
On the other hand, the By the way, in which case are you throwing an exception from the mapper? |
@minwoox In our case, json parser throws exception if the json format is invalid like below.
Some our mapper implementations re-throws exception by expecting infinite retry until the json format is fixed on central dogma like above. We often use central dogma as dynamically reloadable setting repository (dynamically := reloadable without application restart).
To implement such behavior with minimum care, catching and ignoring |
Thanks for sharing your use case. 👍 |
MappingWatcher
stops watching when the mapper throws exception.It's error-prone since the behavior is different from FileWatcher. FileWatcher retries watching when its mapper throws exception.
I'd like to suggest fixing
MappingWatcher
not to close on mapper exception.It makes error handling in mapper function simpler in usual and the behavior matches to
FileWatcher
.The text was updated successfully, but these errors were encountered: