ptupitsyn commented on a change in pull request #8206:
URL: https://github.com/apache/ignite/pull/8206#discussion_r488760425
##########
File path:
modules/core/src/main/java/org/apache/ignite/internal/client/thin/ReliableChannel.java
##########
@@ -169,8 +167,10 @@
// No-op.
}
- for (ClientChannelHolder hld : channels)
- hld.closeChannel();
+ if (channels.get() != null) {
+ for (ClientChannelHolder hld: channels.get())
Review comment:
Sure, with current usages it may work, but the approach is fragile and
hard to trace. See how you had to check every usage to make sure this logic is
safe?
For volatiles and atomics it is a common practice to copy the value into a
variable when you do multiple access and/or conditional logic:
* Easy to see that it is safe - less cognitive load
* Faster
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]