Forum Discussion
Note book Session - Disconnects while running
Hello,
I am running a notebook that copies data from a SharePoint-hosted Excel file into a Delta Lake table. I’ve started noticing unusual behavior that began a couple of hours ago.
While the notebook is actively running, the session suddenly disconnects and displays the message: Session is inactive. I’ve reviewed the settings and confirmed that the session timeout is configured for 30 minutes of inactivity. However, in this case, the disconnection is happening even though the notebook is still actively processing.
Could any one please help investigate why the session is being terminated despite ongoing activity? Anonymous
Thank you.
Thanks everyone .
It turned out to be an external factor related to token expiration during the SharePoint access. After addressing the notebook runs are stable and as expected and the problem is resolved at our end ..
5 Replies
- v-sshirivoluCommunity Support
Hi nagakosuri ,
The behavior described matches how notebook platforms track session activity compared to how Spark runs distributed tasks. Session timeouts usually depend on activity detected on the driver, like running cells, generating output, or sending heartbeat signals to the control plane. However, long running Spark tasks such as large Delta Lake writes or blocking I/O when reading from SharePoint, mainly happen on executor nodes or leave the driver waiting without visible activity. As a result, the driver may look idle to the control plane, even though computation is still happening in the background. If this apparent inactivity lasts longer than the set timeout, the platform might label the session as inactive and end it. So, the disconnection isn’t caused by a Spark job failure, but by the inactivity detection relying on driver-side signals that don’t always show ongoing work.- v-sshirivoluCommunity Support
Hi nagakosuri ,
I hope the information provided above assists you in resolving the issue. If you have any additional questions or concerns, please do not hesitate to contact us. We are here to support you and will be happy to help with any further assistance you may need.
- svenchioSuper User
Hi nagakosuri this behavior is usually not caused by notebook inactivity itself, but by factors outside the notebook execution, in many analytics platforms (e.g., Fabric, Databricks, Synapse), the browser/UI session can disconnect due to SSO token expiration, corporate security policies, etc.; additionally, when reading from SharePoint, the OAuth access tokens can expire mid-run, causing the connector to fail or stall and terminate the session abruptly 😬
In short, “Session is inactive” not always reflects notebook inactivity, so, you need to look at this more broadly... as you can see there are many factors unique to your execution (network, config, etc.) so, you need to check your execution logs to get more information and pin-point the reason.
The take away is that, your investigation needs to first identify who's actually terminating the connection, the notebook or something external? what does the executions logs say? for instance, are you observing time-outs? token expirations? etc.
If you share more information, we could help diagnose the issue, for the time being, hope this brainstomr session helps ... kudos if you find it useful, all the best.
- nagakosuriRegular Visitor
Thanks everyone .
It turned out to be an external factor related to token expiration during the SharePoint access. After addressing the notebook runs are stable and as expected and the problem is resolved at our end ..
- v-sshirivoluCommunity Support
Hi nagakosuri ,
Thanks for confirming it was resolved and for sharing the root cause. Token expiration issues with SharePoint can definitely cause unexpected notebook disconnects. This will help others who run into similar behavior.