Skip to content

Commit

Permalink
ODP-1451 LLAP MDC from NDC string class cast exception. (#15)
Browse files Browse the repository at this point in the history
* ODP-1451 LLAP MDC from NDC string class cast exception

* ODP-1451 LLAP MDC from NDC string class cast exception

---------

Co-authored-by: shubhamsharma <[email protected]>
  • Loading branch information
2 people authored and basapuram-kumar committed Jun 17, 2024
1 parent f8dfef9 commit 3c00ed1
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,18 @@ public LlapTaskUmbilicalProtocol run() throws Exception {

private void setMDCFromNDC() {
final Stack<String> clonedNDC = NDC.cloneStack();
final String fragId = clonedNDC.pop();
final String queryId = clonedNDC.pop();
final String dagId = clonedNDC.pop();
if(!clonedNDC.empty())
LOG.debug("Get the class name " + clonedNDC.peek().getClass());

final String fragId = clonedNDC.empty() ? "":clonedNDC.pop().toString();
LOG.debug("FragId " + fragId);

final String queryId = clonedNDC.empty() ? "":clonedNDC.pop().toString();
LOG.debug("queryId " + queryId);

final String dagId = clonedNDC.empty() ? "":clonedNDC.pop().toString();
LOG.debug("dagId " + dagId);

MDC.put("dagId", dagId);
MDC.put("queryId", queryId);
MDC.put("fragmentId", fragId);
Expand Down

0 comments on commit 3c00ed1

Please sign in to comment.