NIFI-15570: Keep track of Content Claims where the last Claim in a Re… by markap14 · Pull Request #10874 · apache/nifi
The truncate method doesn't verify that the claimant count is still 0 before truncating. If a clone operation increments the claimant count while the truncation task is mid-flight, we could truncate content that is still referenced. Isn't it a concern?
Wondering if we could have a race condition:
TruncateClaims.truncateClaims()checksclaim.isTruncationCandidate()and seestrue- A clone operation calls
incrementClaimaintCount(), which setstruncationCandidate = falseand increments the claimant count TruncateClaims.truncate()proceeds to truncate the file anyway, corrupting the data for the newly cloned FlowFile
Or maybe this scenario is not an option for some reasons that I missed?