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
질문됨 9달 전776회 조회
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
답변함 9달 전
  • 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.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠