rliszli commented on code in PR #6281:
URL: https://github.com/apache/nifi/pull/6281#discussion_r948705878


##########
c2/c2-client-bundle/c2-client-service/src/main/java/org/apache/nifi/c2/client/service/C2ClientService.java:
##########
@@ -41,8 +41,12 @@ public C2ClientService(C2Client client, C2HeartbeatFactory 
c2HeartbeatFactory, C
     }
 
     public void sendHeartbeat(RuntimeInfoWrapper runtimeInfoWrapper) {
-        C2Heartbeat c2Heartbeat = 
c2HeartbeatFactory.create(runtimeInfoWrapper);
-        client.publishHeartbeat(c2Heartbeat).ifPresent(this::processResponse);
+        try {
+            C2Heartbeat c2Heartbeat = 
c2HeartbeatFactory.create(runtimeInfoWrapper);
+            
client.publishHeartbeat(c2Heartbeat).ifPresent(this::processResponse);
+        } catch (Exception e) {

Review Comment:
   This was added as a safety net. Without it, if an unhandled exception 
thrown, the heartbeating stops. During the local development I run into this 2 
times. One from the deserialization in C2HttpClient.sendHeartbeat() and one 
from the UpdateConfigurationOperationHandler.  The later got fixed locally as 
you suggested.  The 1st happened due to wrong input which, I think, can happen. 
If you still think it should be removed, let me know and I'll remove it.



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

Reply via email to