You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2023/01/13 13:26:09 UTC

[GitHub] [skywalking] kezhenxu94 commented on a diff in pull request #10275: Fix gRPC alarm cannot update settings from dynamic configuration sour…

kezhenxu94 commented on code in PR #10275:
URL: https://github.com/apache/skywalking/pull/10275#discussion_r1069451445


##########
oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/grpc/GRPCCallback.java:
##########
@@ -156,6 +152,7 @@ private void onGRPCAlarmSettingUpdated(GRPCAlarmSetting grpcAlarmSetting) {
         }
 
         if (!grpcAlarmSetting.equals(alarmSetting)) {
+            alarmSetting = grpcAlarmSetting;

Review Comment:
   `alarmSetting`, `grpcClient` and `alarmServiceStub` are updated in 2 threads (one in constructor, main thread, one in the scheduled thread pool threads), so you'd better add `volatile` modifier to these fields.



-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org