-
Notifications
You must be signed in to change notification settings - Fork 4.8k
HIVE-29780: Fix LLAP plugin rendezvous race under concurrent DAGs (NullPointerException in LlapTaskCommunicator.setResponse) #6659
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,6 +24,7 @@ | |
| import org.apache.hadoop.io.Text; | ||
| import org.apache.hadoop.metrics2.MetricsSource; | ||
| import org.apache.hadoop.metrics2.MetricsSystem; | ||
| import org.apache.hadoop.yarn.api.records.ApplicationAttemptId; | ||
| import org.apache.hadoop.yarn.api.records.ApplicationId; | ||
|
|
||
| import org.apache.hadoop.hive.registry.impl.TezAmRegistryImpl; | ||
|
|
@@ -198,9 +199,10 @@ | |
| "Lock metrics for R/W locks LLAP task scheduler", LOCK_METRICS); | ||
| } | ||
|
|
||
| // TODO: this is an ugly hack; see the same in LlapTaskCommunicator for discussion. | ||
| // This only lives for the duration of the service init. | ||
| static LlapTaskSchedulerService instance = null; | ||
| // Cross-plugin rendezvous keyed on ApplicationAttemptId — see the discussion on the parallel | ||
| // pendingCommunicators map in LlapTaskCommunicator. | ||
| static final ConcurrentMap<ApplicationAttemptId, LlapTaskSchedulerService> pendingSchedulers = | ||
|
Check warning on line 204 in llap-tez/src/java/org/apache/hadoop/hive/llap/tezplugins/LlapTaskSchedulerService.java
|
||
| new ConcurrentHashMap<>(); | ||
|
|
||
| private final Configuration conf; | ||
|
|
||
|
|
@@ -470,15 +472,15 @@ | |
| this.workloadManagementEnabled = | ||
| !StringUtils.isEmpty(conf.get(ConfVars.HIVE_SERVER2_TEZ_INTERACTIVE_QUEUE.varname, "").trim()); | ||
|
|
||
| ApplicationAttemptId appAttemptId = getContext().getApplicationAttemptId(); | ||
| synchronized (LlapTaskCommunicator.pluginInitLock) { | ||
| LlapTaskCommunicator peer = LlapTaskCommunicator.instance; | ||
| LlapTaskCommunicator peer = LlapTaskCommunicator.pendingCommunicators.remove(appAttemptId); | ||
| if (peer != null) { | ||
| // We are the last to initialize. | ||
| // We are the last to initialize for this DAG. | ||
| this.setTaskCommunicator(peer); | ||
| peer.setScheduler(this); | ||
| LlapTaskCommunicator.instance = null; | ||
| } else { | ||
| instance = this; | ||
| pendingSchedulers.put(appAttemptId, this); | ||
| } | ||
|
Comment on lines
+475
to
484
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this makes sense to me however, this is not true: "a later communicator init to pair with a stopped scheduler" <- this cannot happen, as both the schedulers and communicators are keyed with ApplicationAttemptId, and every new JVM-local DAGAppMaster gets a new application id...so the risk is not accidental re-pairing, just a simple leak, which has to be avoided |
||
| } | ||
| } | ||
|
|
||
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.
makes sense, let me try to add a unit test