reiabreu commented on code in PR #9153:
URL: https://github.com/apache/storm/pull/9153#discussion_r4167446117
##########
storm-server/src/main/java/org/apache/storm/daemon/supervisor/timer/SupervisorHeartbeat.java:
##########
@@ -159,10 +159,18 @@ private Map<String, Double>
mkSupervisorCapacities(Map<String, Object> conf) {
@Override
public void run() {
- Map<String, Object> validatedNumaMap =
SupervisorUtils.getNumaMap(conf);
- Map<String, SupervisorInfo> supervisorInfoList =
buildSupervisorInfo(conf, supervisor, validatedNumaMap);
- for (Map.Entry<String, SupervisorInfo> supervisorInfoEntry :
supervisorInfoList.entrySet()) {
-
stormClusterState.supervisorHeartbeat(supervisorInfoEntry.getKey(),
supervisorInfoEntry.getValue());
+ try {
+ Map<String, Object> validatedNumaMap =
SupervisorUtils.getNumaMap(conf);
+ Map<String, SupervisorInfo> supervisorInfoList =
buildSupervisorInfo(conf, supervisor, validatedNumaMap);
+ for (Map.Entry<String, SupervisorInfo> supervisorInfoEntry :
supervisorInfoList.entrySet()) {
+
stormClusterState.supervisorHeartbeat(supervisorInfoEntry.getKey(),
supervisorInfoEntry.getValue());
+ }
+ } catch (Exception e) {
+ // A missed heartbeat is harmless: nimbus.supervisor.timeout.secs
(default 30s)
+ // allows 6 missed beats before the supervisor is considered dead.
The next
+ // heartbeat (5s later) will retry. Killing the entire supervisor
process
+ // over one missed beat is not acceptable.
+ LOG.warn("Supervisor heartbeat failed, will retry next cycle", e);
}
Review Comment:
Scope the `catch` to the ZK write so a transient blip is skipped, but a
persistent *local* failure (NUMA map, resource capacities) still surfaces
instead of being swallowed forever. Also fixes the default in the comment (60s,
not 30s).
```suggestion
Map<String, Object> validatedNumaMap =
SupervisorUtils.getNumaMap(conf);
Map<String, SupervisorInfo> supervisorInfoList =
buildSupervisorInfo(conf, supervisor, validatedNumaMap);
for (Map.Entry<String, SupervisorInfo> supervisorInfoEntry :
supervisorInfoList.entrySet()) {
try {
stormClusterState.supervisorHeartbeat(supervisorInfoEntry.getKey(),
supervisorInfoEntry.getValue());
} catch (Exception e) {
// A missed heartbeat is harmless:
nimbus.supervisor.timeout.secs (default 60s) tolerates
// several missed beats; the next beat (5s later) retries.
Local/config errors are left
// outside this catch so a persistent misconfiguration still
surfaces instead of being
// swallowed every cycle.
LOG.warn("Supervisor heartbeat for {} failed, will retry
next cycle",
supervisorInfoEntry.getKey(), e);
}
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]