showuon commented on PR #25088: URL: https://github.com/apache/flink/pull/25088#issuecomment-2230745919
> But I can't treat your PR as 'another solution'. The main difference is the lock usage in write. Why you directly submit a PR instead of providing a suggestion, when I'm still active in community? Actually I'm open for any suggestion, it would be fine if you do so. Sorry @Zakelly , I didn't mean to take over your credit! Actually, My original thought is to add test for this PR. Then, change the solution to this: https://github.com/apache/flink/compare/master...showuon:flink:FLINK-28984_2?expand=1 . The main point is: 1. Don't lock in `write` method 2. Only lock when first time entering `flushToFile` method. 3. Lock `close` and `closeAndGetHandle` 4. With this, we can always make sure the stream will be closed correctly, while the lock overhead will be kept low. But after re-checking your PR and description, I found we need to lock `write` because there could be possible that the stream is closed, but data is only partially written. So I changed it again, to the version you saw right now. You're right, this is not another solution at all. I should have left comments directly. Sorry about that! I've added you as co-author in my PR. Sorry again! -- 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]
