kaichiachen commented on code in PR #950:
URL: https://github.com/apache/yunikorn-k8shim/pull/950#discussion_r1950422762
##########
pkg/dispatcher/dispatcher.go:
##########
@@ -71,7 +72,13 @@ func initDispatcher() {
}
dispatcher.setRunning(false)
DispatchTimeout = conf.GetSchedulerConf().DispatchTimeout
- AsyncDispatchLimit = max(10000, int32(eventChannelCapacity/10))
+ // Convert to int32 first to avoid potential integer overflow
+ if eventChannelCapacity < math.MinInt32 || eventChannelCapacity >
math.MaxInt32 {
+ // Handle the overflow scenario appropriately
+ panic(fmt.Sprintf("eventChannelCapacity value %d is out of
int32 range", eventChannelCapacity))
Review Comment:
OK, let me remove panic here
--
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]