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

[BUG] Manual cancel REPL session in EMR-S console, Shutting down hock does not update state. #269

Open
penghuo opened this issue Mar 5, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@penghuo
Copy link
Collaborator

penghuo commented Mar 5, 2024

What is the bug?

  • user manually cancel session in EMR-S.
  • job state is running
24/03/05 03:19:43 INFO FlintREPL: Updated job: {"jobid": 00fhhv3f7tqslo0a, "sessionId": dDllcU1BSGxOZW15czM=} from .query_execution_request_mys3
24/03/05 03:19:43 INFO FlintREPL: read from .query_execution_request_mys3, sessionId: dDllcU1BSGxOZW15czM=
...
24/03/05 03:19:44 INFO FlintREPL: Shutting down REPL

What is the expected behavior?

  • index state is update to "dead" or "fail"
  • add more log if getResponse is empty or source is empty
    shutdownHookManager.addShutdownHook(() => {
      logInfo("Shutting down REPL")
      val getResponse = osClient.getDoc(sessionIndex, sessionId)
      if (!getResponse.isExists()) {
        return
      }

      val source = getResponse.getSourceAsMap
      if (source == null) {
        return
      }

      val state = Option(source.get("state")).map(_.asInstanceOf[String])
      if (!earlyExitFlag && state.isDefined && state.get != "dead" && state.get != "fail") {
        updateFlintInstanceBeforeShutdown(
          source,
          getResponse,
          flintSessionIndexUpdater,
          sessionId,
          sessionTimerContext)
      }
    })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants