Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix NPEs in TypesAccumulator #1363

Merged
merged 1 commit into from
Oct 7, 2024
Merged

Fix NPEs in TypesAccumulator #1363

merged 1 commit into from
Oct 7, 2024

Commits on Oct 4, 2024

  1. Fix NPEs in TypesAccumulator

    We've seen exceptions in spark executors like:
    
    ```
    java.lang.NullPointerException: Cannot invoke "scala.collection.mutable.Set.isEmpty()" because the return value of "com.snowplowanalytics.snowplow.rdbloader.transformer.batch.spark.TypesAccumulator.accum()" is null
    ```
    
    The error is coming from our Spark Accumulator for accumulating Iglu
    types. This is similar to [an issue previously seen][1] in Spark's own
    `CollectionAccumulator`. That issue [was fixed in Spark][2] by making
    the accumulator's internal state non-final, and synchronizing access to
    the internal state. So here we make the exact same change to our own
    Accumulator.
    
    It is a rare race condition which is hard to reproduce.
    
    [1]: https://issues.apache.org/jira/browse/SPARK-20977
    [2]: apache/spark#31540
    istreeter authored and spenes committed Oct 4, 2024
    Configuration menu
    Copy the full SHA
    d540e99 View commit details
    Browse the repository at this point in the history