Sticky AWS Glue Notebook Sessions

1

I work a lot using AWS Glue Notebooks and I cannot find a way to restart sessions seamlessly. The use case is the following:

  • I start a notebook
  • After a while I need to change some config in the current session
  • I restart the kernel
  • The session goes in stopped state
  • The %status magic returns: "There is no current session"
  • When I attempt to recreate a session I get the following exception:
An error occurred (AlreadyExistsException) when calling the CreateSession operation: Session already created, sessionId=2167b01d-43a3-49e1-a2ee-c804e6940e83

The only workaround I found is to delete the session from the console manually. Not the best in my opinion. Is there a best way already available?

profile picture
feita há 8 meses758 visualizações
2 Respostas
1

I have discovered that using the %stop_session magic works. The current session goes in the stopped state and is detached from the kernel. I would suggest to add a macro/widget to the notebook command bar.

profile picture
respondido há 8 meses
  • Ideally it should just detect the kernel restart and do the stop and cleanup automatically, will open a request to see if that's possible

  • Had the same issue and "%stop_session" magic did the trick. Yes, doing this automatically upon kernel restart would be even better.

0

Getting the same issue

Enter image description here

Tony
respondido há 4 meses
  • The session is probably stopping but it has not stopped yet. When this happens to me I normally look for the session in the interactive session list and I check the state. Then I wait or a kill it manually.

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas