line / line/centraldogma

MappingWatcher should not close when mapper throws exception

Open
#995 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

defect
Dominant language
Java
Stars
668
Forks
135
Avg merge
4d 19h
Merged PRs (30d)
7

Description

`MappingWatcher` stops watching [when the mapper throws exception](https://github.com/line/centraldogma/blob/461fc63efd657d625eb0760742fc54240ebc3d7c/client/java/src/main/java/com/linecorp/centraldogma/client/MappingWatcher.java#L81-L90).
It's error-prone since the behavior is different from FileWatcher. FileWatcher retries watching [when its mapper throws exception](https://github.com/line/centraldogma/blob/461fc63efd657d625eb0760742fc54240ebc3d7c/client/java/src/main/java/com/linecorp/centraldogma/client/AbstractWatcher.java#L258).

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`.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with client/java/src/main/java/com/linecorp/centraldogma/client/MappingWatcher.java, especially the mapper-exception handling around lines 81-90. Compare it with the retry behavior in client/java/src/main/java/com/linecorp/centraldogma/client/AbstractWatcher.java around line 258, then verify that MappingWatcher keeps watching after a mapper exception instead of closing.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.