[BUG] Cluster master election scheduler can stop after one renewal exception
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- java
- Domain
- backend, distributed-systems
Research direction
Start by reading shenyu-admin/src/main/java/org/apache/shenyu/admin/mode/cluster/service/ShenyuClusterService.java, focusing on startSelectMasterTask() and doSelectMaster(). Trace how the scheduled task handles renewal exceptions; done means errors are logged without terminating future scheduled election attempts.
Written by the indexing model from the issue text.
Description
Current Behavior
Cluster master election/renewal can stop permanently after one exception escapes the scheduled task.
ShenyuClusterService.startSelectMasterTask() schedules master selection with scheduleAtFixedRate(...):
executorService.scheduleAtFixedRate(() -> doSelectMaster(host, port, contextPath), ...);
doSelectMaster() catches exceptions, closes the check services, and then throws a new ShenyuException:
} catch (Exception e) {
LOG.error("select master error", e);
upstreamCheckService.close();
instanceCheckService.close();
throw new ShenyuException(...);
}
For ScheduledThreadPoolExecutor, an exception escaping a fixed-rate task suppresses later executions of that periodic task. A transient lock/renewal failure can therefore stop future master selection attempts in that process.
Expected Behavior
Master election/renewal errors should be logged and the next scheduled election attempt should still run. Exceptions should not escape the periodic scheduler task.
Impact
After a transient cluster backend failure, the admin node may stop participating in master election until it is restarted.
Code Location
shenyu-admin/src/main/java/org/apache/shenyu/admin/mode/cluster/service/ShenyuClusterService.javastartSelectMasterTask()schedules the periodic task.doSelectMaster()rethrows from the catch block.
- Dominant language
- Java
- Stars
- 8.8k
- Forks
- 3.1k
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 85
Contributor guide
No contributing guide indexed for this repository
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.
More from apache/shenyu
-
plugin: mock priority: medium type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
-
admin priority: medium type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
[BUG] DivideIngressParser protocol[i++] throws AIOOBE when protocol array shorter than endpoints Openkubernetes priority: medium type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
[BUG] ContextPathParser concatenates null annotation value with /** — literal null/** rule condition Openkubernetes priority: medium type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
kubernetes priority: medium type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100