Forum Discussion
Notebook Status - Stopped (Session Timed Out)
- 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. ๐
1. Check Spark Session Timeout Settings:
Even though the Spark session timeout is set to 30 minutes, sometimes the default Spark configuration can cause the session to timeout if there is no activity (like reading or writing data). You can verify and adjust your session settings to ensure they align with the specific workload you're running.
How to Adjust Spark Timeout Settings:
Try modifying the Spark configuration within your notebook to allow for more leniency during the runtime.
Use the following command to explicitly set the timeout settings within the notebook itself:
If this solution works for you, feel free to like it and confirm that itโs suitable for your case.
Hi Rufyda,
Thank you for your response. and now I can see that the status in the recent run list shows "stopped". My question is, earlier it showed "success" and from yesterday it showed "stopped (session timed out)" and after applying the code you gave me it shows "stopped".
Is there a way to fix this to show "success" just like before? Have you faced anything similiar? ๐