spring-cloud / spring-cloud/spring-cloud-consul
ConfigWatch doesn't publish update-event after Consul restarting even when value was changed
Open
Nobody has claimed this yet.
waiting-for-triage
- Dominant language
- Java
- Stars
- 822
- Forks
- 539
- Avg merge
- 9h 31m
- Merged PRs (30d)
- 7
Description
Describe the bug
Version: 2.2.7.RELEASE
This is floating bug. ConfigWatch holds last saved index, but after Consul restarting, Consul can set same index for value therefore ConfigWatch doesn't publish updating event.
if (!this.consulIndexes.containsValue(newIndex) && !currentIndex.equals(-1L)) {
log.trace("Context " + context + " has new index "+ newIndex);
RefreshEventData data = new RefreshEventData(context, currentIndex, newIndex);
this.publisher.publishEvent(new RefreshEvent(this, data, data.toString()));
Sample
- Put KV
- Restart Consul
- Put same key with changed value in Consul
AR: ConsulWatch didn't publish update event
ER: ConsulWatch published update event
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in ConfigWatch, focusing on the Consul index tracking and the shown condition that publishes RefreshEvent. Reproduce the sequence of putting a KV, restarting Consul, and changing the same key; done means the update event is published after the value changes even when Consul reuses the index.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- backend, distributed-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100