GitHub user PiXOT97 created a discussion: Embedded dashboards: Celery tasks 
keep running after close (GAQ)

<html>
<body>
<!--StartFragment--><p data-start="212" data-end="362">When using <strong 
data-start="223" data-end="248">async query execution</strong> (Celery + Redis) 
in <strong data-start="269" data-end="294">Apache Superset 4.1.2</strong>, each 
chart in a dashboard is executed as a separate Celery task.</p>
<p data-start="364" data-end="682">In my setup, I have <strong data-start="384" 
data-end="407">embedded dashboards</strong> with <strong data-start="413" 
data-end="427">30+ charts</strong>, each generating heavy OLAP queries.<br 
data-start="464" data-end="467">
If a user closes the embed or navigates to another dashboard before all charts 
finish loading, Superset continues executing all those Celery tasks in Redis — 
even though those charts are no longer visible or needed.</p>
<p data-start="684" data-end="843">This results in unnecessary load on both the 
<strong data-start="729" data-end="747">Celery workers</strong> and the <strong 
data-start="756" data-end="768">database</strong>, since the tasks and queries 
keep running to completion in the background.</p>
<hr data-start="845" data-end="848">
<h3 data-start="850" data-end="866"><strong data-start="854" 
data-end="866">Question</strong></h3>
<ul data-start="868" data-end="1283">
<li data-start="868" data-end="1000">
<p data-start="870" data-end="1000">Is there any supported way to <strong 
data-start="900" data-end="920">cancel or revoke</strong> those Celery / Redis 
tasks when the embedded dashboard is closed or reloaded?</p>
</li>
<li data-start="1001" data-end="1080">
<p data-start="1003" data-end="1080">Has this been <strong data-start="1017" 
data-end="1065">fixed or improved in newer Superset versions</strong> after 
4.1.2?</p>
</li>
<li data-start="1081" data-end="1283">
<p data-start="1083" data-end="1148">If not, is there any plan to add a 
configuration or API, such as:</p>
<pre class="overflow-visible!" data-start="1152" data-end="1206"><div 
class="contain-inline-size rounded-2xl relative 
bg-token-sidebar-surface-primary"><div class="sticky top-9"><div 
class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div 
class="bg-token-bg-elevated-secondary text-token-text-secondary flex 
items-center gap-4 rounded-sm px-2 font-sans text-xs"></div></div></div><div 
class="overflow-y-auto p-4" dir="ltr"><code class="whitespace-pre! 
language-python"><span><span>CANCEL_QUERY_ON_WINDOW_UNLOAD = </span><span><span 
class="hljs-literal">True</span></span><span>
</span></span></code></div></div></pre>
<p data-start="1210" data-end="1283">to automatically cancel background queries 
when the user leaves the page?</p>
</li>
</ul>
<hr data-start="1285" data-end="1288">
<h3 data-start="1290" data-end="1309"><strong data-start="1294" 
data-end="1309">Environment</strong></h3>

Component | Version / Config
-- | --
Superset | 4.1.2
Async Engine | Celery + Redis
Context | Embedded dashboards with 30+ charts

<!--EndFragment-->
</body>
</html>

GitHub link: https://github.com/apache/superset/discussions/35720

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to