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
gefragt vor 9 Monaten790 Aufrufe
2 Antworten
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
beantwortet vor 9 Monaten
  • 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
beantwortet vor 4 Monaten
  • 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.

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen