spring-cloud / spring-cloud/spring-cloud-consul

ConfigWatch doesn't publish update-event after Consul restarting even when value was changed

Open
#731 0 comments 0 reactions 0 assignees View on GitHub

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

  1. Put KV
  2. Restart Consul
  3. Put same key with changed value in Consul
    AR: ConsulWatch didn't publish update event
    ER: ConsulWatch published update event

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.