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

[GOBBLIN-1906] Add null-check to JobConfigurationUtils.putStateIntoConfiguration to avoid IllegalArgumentException #3770

Merged

Conversation

phet
Copy link
Contributor

@phet phet commented Sep 13, 2023

Dear Gobblin maintainers,

Please accept this PR. I understand that it will not be reviewed until I have checked off all the steps below!

JIRA

Description

  • Here are some details about my PR, including screenshots (if applicable):
    A customer reported seeing:
Error: java.io.IOException: Task failed: java.lang.IllegalArgumentException: The value of property <<redacted>> must not be null
  at com.google.common.base.Preconditions.checkArgument(Preconditions.java:146)
  at org.apache.hadoop.conf.Configuration.set(Configuration.java:1260)
  at org.apache.hadoop.conf.Configuration.set(Configuration.java:1241)
  at org.apache.gobblin.util.JobConfigurationUtils.putStateIntoConfiguration(JobConfigurationUtils.java:95)
...

the appears to arise from concurrent modification to the State's underlying Properties (i.e. between the time the keySet() is first read and when each value is accessed from the same Properties).

although the customer's impl seems to warrant synchronization, given that a null-value is certain to be rejected by o.a.hadoop.conf.Configuration, defensively filter those out ahead of time.

Tests

  • My PR adds the following unit tests OR does not need testing for this extremely good reason:
    no current unit tests for this small utility method

Commits

  • My commits all reference JIRA issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "How to write a good git commit message":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

@Will-Lo Will-Lo changed the title Add null-check to JobConfigurationUtils.putStateIntoConfiguration to avoid IllegalArgumentException [GOBBLIN-1906] Add null-check to JobConfigurationUtils.putStateIntoConfiguration to avoid IllegalArgumentException Sep 13, 2023
Comment on lines +319 to +320
// NOTE: `warn` level is hack for including path among automatic troubleshooter 'issues'
LOG.warn("Cancelling job after persisting workunits beneath: " + this.jobInputPath);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: this trivial change is unrelated

@codecov-commenter
Copy link

codecov-commenter commented Sep 13, 2023

Codecov Report

Merging #3770 (f78cd9e) into master (16389dc) will increase coverage by 0.94%.
Report is 1 commits behind head on master.
The diff coverage is 20.00%.

@@             Coverage Diff              @@
##             master    #3770      +/-   ##
============================================
+ Coverage     46.39%   47.33%   +0.94%     
- Complexity     9553    10954    +1401     
============================================
  Files          1871     2152     +281     
  Lines         74831    85097   +10266     
  Branches       8347     9448    +1101     
============================================
+ Hits          34716    40279    +5563     
- Misses        36986    41172    +4186     
- Partials       3129     3646     +517     
Files Changed Coverage Δ
...pache/gobblin/runtime/mapreduce/MRJobLauncher.java 52.20% <0.00%> (ø)
...org/apache/gobblin/util/JobConfigurationUtils.java 0.00% <0.00%> (ø)
...rg/apache/gobblin/writer/GobblinBaseOrcWriter.java 73.23% <100.00%> (-0.38%) ⬇️

... and 289 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@Will-Lo Will-Lo merged commit a289613 into apache:master Sep 18, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants