theosib-amazon commented on PR #959: URL: https://github.com/apache/parquet-mr/pull/959#issuecomment-1195676003
I just thought of something that makes me nervous about this PR that requires further investigation. Consider the following scenario: - Thread A allocates a codec - Thread A releases the codec, which puts it into a global pool of codecs - Thread B allocates the same kind of codec, which comes from that same pool - Thread A allocates that same kind of codec again, but it gets it from the factory's map instead of the pool I'm concerned that this could result in the same codec being given to both threads at the same time. The solution would be to remove the codec from the factory's map when release() is called on the codec itself. Note that this problem is not introduced by this PR, since the double pooling existed before. The irony is that the pool is thread-safe, while the factory was not. -- 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]
