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
已提问 8 个月前763 查看次数
2 回答
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
已回答 8 个月前
  • 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
已回答 4 个月前
  • 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.

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则