long bufferCapacityInBytes = bufferConfig.getMaxSize();
long maxWindowSizeInBytes = (long) ((connConfig
.getCheckpointThresholdPct() / 100.0) * bufferCapacityInBytes);
//After DDSDBUS-3222, this condition essentially boils down to : checkpointThresholdPct can at most be 100-(10K/maxSize) - in practice at least 99.99%
if ((maxWindowSizeInBytes + connConfig.getFreeBufferThreshold()) > bufferCapacityInBytes) {
throw new InvalidConfigException(
"Invalid configuration. Could lead to deadlock: ((checkPointThresholdPct*maxSize) + freeBufferThreshold) > maxSize"
+ " freeBufferThreshold=" + _freeBufferThreshold + " checkpointThresholdPct=" + _checkpointThresholdPct
+ " maxSize=" + bufferCapacityInBytes);
}
int readBufferSize = bufferConfig.getReadBufferSize();
//After DDSDBUS-3222, this condition essentially boils down to : is readBufferSize > 10K - which is the fixed size of freeBufferThreshold
if (readBufferSize <= connConfig.getFreeBufferThreshold() )
{
throw new InvalidConfigException(
"Invalid configuration. Could lead to deadlock: readBufferSize <= freeBufferThreshold. Increase readBufferSize to be greater than freeBufferThreshold "
+ " readBufferSize=" + readBufferSize + " freeBufferThreshold= " + _freeBufferThreshold
);
}
}