plotly / plotly/dash

slow callbacks are all pruned in the presence of a dcc.Interval

Open
#1,613 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P3
Dominant language
Python
Stars
24.4k
Forks
2.3k
Avg merge
2d 7h
Merged PRs (30d)
13

Description

If the callbacks triggered by a dcc.Interval take longer to complete than the refresh time, they all get pruned and nothing updates.

Example app:

import dash
from dash.dependencies import Input, Output
import dash_core_components as dcc
import dash_html_components as html
import time
app = dash.Dash(__name__)
app.layout = html.Div([
    dcc.Interval(id='i', interval=2000),
    html.Div(id='o')
])
i = 0
@app.callback(Output('o', 'children'), Input('i', 'n_intervals'))
def update_output(n):
    global i
    i += 1
    print([n, i])
    time.sleep(5)
    print([n, i])
    return str([n, i])
app.run_server(debug=True)
dash                 1.20.0
dash-core-components 1.16.0
dash-html-components 1.1.3
dash-renderer        1.9.1
dash-table           4.11.3

Describe the bug

The page never updates: callbacks are all pruned.

From the network tab:

-----
   -----
      -----
         -----

Expected behavior

One callback should eventually complete.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the example app with dcc.Interval, the callback, and the network-tab request pattern shown in the issue. Trace how overlapping interval-triggered callbacks are pruned, then verify that at least one callback completes and updates the output when its runtime exceeds the interval.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
full-stack
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.