Skip to content

Commit

Permalink
HIVE-24294: TezSessionPool sessions can throw AssertionError (apache#…
Browse files Browse the repository at this point in the history
…1596) (Naresh Panchetty Ramanaiah, reviewed by Mustafa Iman, Laszlo Pinter)
  • Loading branch information
nareshpr authored Oct 28, 2020
1 parent db895f3 commit 78840c2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -495,12 +495,11 @@ public TezSessionState reopen(TezSessionState sessionState) throws Exception {

static void reopenInternal(
TezSessionState sessionState) throws Exception {
HiveResources resources = sessionState.extractHiveResources();
// TODO: close basically resets the object to a bunch of nulls.
// We should ideally not reuse the object because it's pointless and error-prone.
sessionState.close(false);
sessionState.close(true);
// Note: scratchdir is reused implicitly because the sessionId is the same.
sessionState.open(resources);
sessionState.open(sessionState.extractHiveResources());
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public void testSessionReopen() {

poolManager.reopen(session);

Mockito.verify(session).close(false);
Mockito.verify(session).close(true);
Mockito.verify(session).open(Mockito.<TezSessionState.HiveResources>any());

// mocked session starts with default queue
Expand Down Expand Up @@ -329,7 +329,7 @@ public void testCloseAndOpenDefault() throws Exception {

poolManager.reopen(session);

Mockito.verify(session).close(false);
Mockito.verify(session).close(true);
Mockito.verify(session).open(Mockito.<TezSessionState.HiveResources>any());
}

Expand Down

0 comments on commit 78840c2

Please sign in to comment.