[#2544] fix(client): NPE about StatisticsCodec #2547
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Converting
List<codeCost>
into a synchronize listWhy are the changes needed?
this bugs happened in concurrent environment when spark workers with the
RssShuffleManager
and spark.rss.client.io.compression.statisticsEnabled property enabled, logs its compression statistics when finished, but since the class was not prepared for concurrent enviroment, at the time to callList<codeCost>
into thecodec.statistics()
methods enters in a race condition.Fix: # 2544
Does this PR introduce any user-facing change?
No.
How was this patch tested?
this issue was diffcult to replicate into a local enviroment, but instead when the patch was applied, i make sure the application continue working as usual by:
1- deploying the application based on
./deploy/docker/read.me
2- when executing the spark-shell make sure to do it by including the
spark.rss.client.io.compression.statisticsEnabled
props as follow:3- run multipe spark scala jobs
4- when finishing, into each worker, look for the logs in
/opt/spark/work/...
5- looks for every entry in the file that succesfully logs the statistics.