xitongsys / parquet-go

pure golang library for reading/writing parquet file
Apache License 2.0
1.25k stars 294 forks source link

fix race condition during WriteStop #560

Open hangxie opened 1 year ago

hangxie commented 1 year ago

This is for https://github.com/xitongsys/parquet-go/issues/559, tested with my code.

This may not be the best fix, I didn't test performance penalty from this but since most Write are slow due to IO, I think we can live with it.

hangxie commented 3 weeks ago

@xitongsys would you please take a look at this PR? Two fixes included are pretty critical to address race conditions.

Just in case you have concern on performance issue in the description - since the WriteStop will be called only whenever ... write stops, so I don't think adding locking mechanism around codes will be a significant performance problem.