<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Kill/Cancel a Notebook Cell Running Too Long on an All-purpose Cluster in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/kill-cancel-a-notebook-cell-running-too-long-on-an-all-purpose/m-p/152417#M53820</link>
    <description>&lt;P&gt;What I’m looking for is a workspace-level monitoring approach: detect any notebook execution where a cell (or the run) has been running longer than a threshold, and then cancel/terminate it automatically.&lt;/P&gt;&lt;P&gt;I’ve tried looking into audit tables, REST APIs, but it seems they don’t provide enough visibility at cell-level&lt;/P&gt;</description>
    <pubDate>Sun, 29 Mar 2026 02:20:52 GMT</pubDate>
    <dc:creator>zenwanderer</dc:creator>
    <dc:date>2026-03-29T02:20:52Z</dc:date>
    <item>
      <title>Kill/Cancel a Notebook Cell Running Too Long on an All-purpose Cluster</title>
      <link>https://community.databricks.com/t5/data-engineering/kill-cancel-a-notebook-cell-running-too-long-on-an-all-purpose/m-p/152378#M53816</link>
      <description>&lt;P&gt;Hi everyone, I’m facing an issue when running a notebook on a Databricks All-purpose cluster. Some of my cells/pipelines run for a very long time, and I want to automatically cancel/kill them when they exceed a certain time limit.&lt;/P&gt;&lt;P&gt;I tried setting spark.databricks.execution.timeout, but it doesn’t seem to have any effect in my case.&lt;/P&gt;&lt;P&gt;What I need is a timeout mechanism that can cancel the currently running notebook cell, not just a Spark job timeout.&lt;/P&gt;&lt;P&gt;If anyone can share guidance or official documentation references, I’d really appreciate it. Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Sat, 28 Mar 2026 16:41:56 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/kill-cancel-a-notebook-cell-running-too-long-on-an-all-purpose/m-p/152378#M53816</guid>
      <dc:creator>zenwanderer</dc:creator>
      <dc:date>2026-03-28T16:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: Kill/Cancel a Notebook Cell Running Too Long on an All-purpose Cluster</title>
      <link>https://community.databricks.com/t5/data-engineering/kill-cancel-a-notebook-cell-running-too-long-on-an-all-purpose/m-p/152384#M53819</link>
      <description>&lt;UL&gt;&lt;LI&gt;You can use signal to do this if running in a notebook for code validation&lt;/LI&gt;&lt;/UL&gt;&lt;LI-CODE lang="python"&gt;#Add in notebook
import signal

class TimeoutException(Exception):
    """Raised when a cell is run for very long time"""

def timeout_handler(signum, frame):
    raise TimeoutException("Timed out!")

def set_cell_timeout(seconds):
    signal.signal(signal.SIGALRM, timeout_handler)
    signal.alarm(seconds)

#Add in a notebook cell running notebook function
try:
    set_cell_timeout(30) # Set for 30 seconds
    #notebook function
finally:
    signal.alarm(0)&lt;/LI-CODE&gt;&lt;UL&gt;&lt;LI&gt;You can use lakeflow job notifications with threshold to cancel jobs running too long.&amp;nbsp;&lt;STRONG&gt;Avoid&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;using signals in notebooks running via jobs&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Sat, 28 Mar 2026 18:25:17 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/kill-cancel-a-notebook-cell-running-too-long-on-an-all-purpose/m-p/152384#M53819</guid>
      <dc:creator>balajij8</dc:creator>
      <dc:date>2026-03-28T18:25:17Z</dc:date>
    </item>
    <item>
      <title>Re: Kill/Cancel a Notebook Cell Running Too Long on an All-purpose Cluster</title>
      <link>https://community.databricks.com/t5/data-engineering/kill-cancel-a-notebook-cell-running-too-long-on-an-all-purpose/m-p/152417#M53820</link>
      <description>&lt;P&gt;What I’m looking for is a workspace-level monitoring approach: detect any notebook execution where a cell (or the run) has been running longer than a threshold, and then cancel/terminate it automatically.&lt;/P&gt;&lt;P&gt;I’ve tried looking into audit tables, REST APIs, but it seems they don’t provide enough visibility at cell-level&lt;/P&gt;</description>
      <pubDate>Sun, 29 Mar 2026 02:20:52 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/kill-cancel-a-notebook-cell-running-too-long-on-an-all-purpose/m-p/152417#M53820</guid>
      <dc:creator>zenwanderer</dc:creator>
      <dc:date>2026-03-29T02:20:52Z</dc:date>
    </item>
    <item>
      <title>Re: Kill/Cancel a Notebook Cell Running Too Long on an All-purpose Cluster</title>
      <link>https://community.databricks.com/t5/data-engineering/kill-cancel-a-notebook-cell-running-too-long-on-an-all-purpose/m-p/152421#M53821</link>
      <description>&lt;P&gt;&lt;STRONG&gt;For the issue -&amp;nbsp;&lt;/STRONG&gt;Some of my cells/&lt;STRONG&gt;pipelines&lt;/STRONG&gt; run for a very long time, and I want to automatically cancel/kill them when they exceed a certain time limit.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;You can use job notifications with Metric threshold (&lt;STRONG&gt;Duration Warning &lt;/STRONG&gt;for notifications&lt;STRONG&gt; &amp;amp; Duration Timeout &lt;/STRONG&gt;for kill) to cancel jobs running too long (completion time more than Duration Timeout). More details &lt;A href="https://docs.databricks.com/aws/en/jobs/configure-job" target="_self"&gt;here&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Sun, 29 Mar 2026 04:58:09 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/kill-cancel-a-notebook-cell-running-too-long-on-an-all-purpose/m-p/152421#M53821</guid>
      <dc:creator>balajij8</dc:creator>
      <dc:date>2026-03-29T04:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: Kill/Cancel a Notebook Cell Running Too Long on an All-purpose Cluster</title>
      <link>https://community.databricks.com/t5/data-engineering/kill-cancel-a-notebook-cell-running-too-long-on-an-all-purpose/m-p/152461#M53823</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/223713"&gt;@zenwanderer&lt;/a&gt;&amp;nbsp;Have you looked into Query Watchdog?&lt;/P&gt;
&lt;P&gt;For Classic All-Purpose clusters this might be your best bet.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.databricks.com/aws/en/compute/troubleshooting/query-watchdog" target="_blank"&gt;https://docs.databricks.com/aws/en/compute/troubleshooting/query-watchdog&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2026 02:09:19 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/kill-cancel-a-notebook-cell-running-too-long-on-an-all-purpose/m-p/152461#M53823</guid>
      <dc:creator>MoJaMa</dc:creator>
      <dc:date>2026-03-30T02:09:19Z</dc:date>
    </item>
  </channel>
</rss>

