-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-29082][CORE] Skip delegation token generation if no credentials are available #25901
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
Conversation
|
The problem with the original code was the following:
If none of them applies on the machine where this test executed then it will fail constantly. The reason why later tests failed:
Because |
|
There are basically 3 ways to set
|
| // krb5.conf. MiniKdc sets "java.security.krb5.conf" in start and removes it when stop called. | ||
| val kdcDir = Utils.createTempDir() | ||
| val kdcConf = MiniKdc.createConf() | ||
| kdc = new MiniKdc(kdcConf, kdcDir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change1: I've added MiniKdc here to set krb5.conf.
| val krbConf = new Configuration() | ||
| krbConf.set(HADOOP_SECURITY_AUTHENTICATION, "kerberos") | ||
|
|
||
| UserGroupInformation.setConfiguration(krbConf) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change2: I've pulled UserGroupInformation.setConfiguration inside the try block.
| Array.empty) | ||
| proxyUser.doAs(testImpl) | ||
| } finally { | ||
| if (kdc != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change3: Stop MiniKdc.
|
Once the test pass I'm going to start it with |
|
Test build #111205 has finished for PR 25901 at commit
|
|
retest this please |
|
The previously problematic execution now passed: |
|
Test build #111220 has finished for PR 25901 at commit
|
|
lgtm, confirmed this version passes for me locally (the old pr did not). |
|
Test build #111229 has finished for PR 25901 at commit
|
|
The failure looks irrelevant to this PR. |
|
Retest this please |
|
Test build #111236 has finished for PR 25901 at commit
|
|
Test build #111237 has finished for PR 25901 at commit
|
|
flakyness hell |
|
retest this please |
|
Test build #111242 has finished for PR 25901 at commit
|
|
cc @vanzin since he is the original author. |
|
Let's try to track the test failures: otherwise we will be stuck on sums of probability of flaky tests. |
https://issues.apache.org/jira/browse/SPARK-29220
https://issues.apache.org/jira/browse/SPARK-29221
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, LGTM. Thank you, @gaborfeher , @srowen , @squito , @HeartSaVioR .
Merged to master.
|
Hey guys, I was out for the last few days, thanks for taking care of it. (Original PR seemed to pass tests here, but I did notice a failure internally in one of our internal branches, and asked people to pay attention to it...) |
|
Thanks guys for the help and taking care of the fix! |
|
i ran into this PR when building master for hadoop 2.7 |
|
oh sorry nevermind. i think its because i was using hadoop 2.7.0 instead of 2.7.4. disregard... i just needed to update an old automated script of ours. |
This PR is an enhanced version of #25805 so I've kept the original text. The problem with the original PR can be found in comment.
This situation can happen when an external system (e.g. Oozie) generates
delegation tokens for a Spark application. The Spark driver will then run
against secured services, have proper credentials (the tokens), but no
kerberos credentials. So trying to do things that requires a kerberos
credential fails.
Instead, if no kerberos credentials are detected, just skip the whole
delegation token code.
Tested with an application that simulates Oozie; fails before the fix,
passes with the fix. Also with other DT-related tests to make sure other
functionality keeps working.