Forum Discussion

Mirdula's avatar
Mirdula
Frequent Visitor
1 year ago
Solved

Notebook Status - Stopped (Session Timed Out)

Hello everyone,  Would appreciate your thoughts on the below.    I had a notebook in the bronze layer, which I used to ingest data from an ERP system. Later, I created a duplicate of this file and...
  • Rufyda's avatar
    1 year ago

    Hi Mirdula ๐Ÿ˜Š

    Thank you for your detailed feedback.

    What you're experiencing is quite common in Spark-based environments like Microsoft Fabric. Here's a quick clarification that may help:

    When a notebook completes all cells successfully, but the Spark session doesn't close explicitly, the Fabric platform sometimes registers the session as "Stopped" instead of "Success" โ€” even though no error occurred.

    What you can try:

    To ensure the session ends gracefully, you can manually stop the Spark session at the end of your notebook using:

     

    spark.stop()

     

    This helps Fabric detect that the notebook has completed intentionally, not due to timeout or inactivity.

    Also, adding a cell like this at the end of your notebook might help signal a successful end:

     

    print("Notebook completed successfully.")

     

    While this doesn't guarantee a โ€œSuccessโ€ label in every case (as it depends on backend handling), it improves the chances โ€” and keeps your logs cleaner.

    Let me know if that helps!
    And if the previous suggestion worked partially, feel free to mark it as solution and give a Kudo if it helped. ๐Ÿ˜„