apoorvmittal10 commented on code in PR #16969:
URL: https://github.com/apache/kafka/pull/16969#discussion_r1754417489
##########
core/src/main/java/kafka/server/share/SharePartition.java:
##########
@@ -995,6 +1004,9 @@ boolean canAcquireRecords() {
* @return A boolean which indicates whether the fetch lock is acquired.
*/
boolean maybeAcquireFetchLock() {
+ if (partitionState() != SharePartitionState.ACTIVE) {
Review Comment:
@junrao We update the partitionState always with write lock.
Though one thisng we can improve in method
`completeInitializationWithException`, the lock is not explicitly attained
which updating `partitionState` but the method is called after attaining lock
itself. But I ll make the change for `completeInitializationWithException`
method as well. Here when `partitionState()` is called then it takes the read
lock. Am I missing somehting 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]