Skip to content

Browser Hang on Multi-Component Update #12932

@gaieges

Description

@gaieges

Browser Hang on Multi-Component Update

Environment Details

  • Gradio Version: 6.7.0
  • Browser: [e.g., Chrome/Safari on macOS]
  • OS: macOS 15.7.4 (24G517) 36 GB Apple M3 Pro
  • Python Version: 3.12.8

Package versions

gradio==6.7.0
gradio-client==2.2.0
numpy==2.4.2
pandas==3.0.1

Symptoms

When a single gr.Button.click event triggers updates to multiple components simultaneously (two Dataframes, and a DownloadButton), the browser tab hangs completely for ~60s or so, on a M3 Pro.

  • The Python backend finishes execution very quickly (verified via logs).
  • The "processing" animation in Gradio hangs or disappears, and the tab becomes unresponsive for several seconds or indefinitely.
  • The second datatable never shows up

Minimal Reproduction

import os
import tempfile

import gradio as gr
import numpy as np
import pandas as pd


def analyze():
    # 1. Summary Markdown
    summary_md = "# 📊 Summary\n- Status: Success"

    # 3. Small Metrics Dataframe
    summary_df = pd.DataFrame(
        {
            "Metric": ["A", "B", "C"],
            "Year 0": ["$100k", "$80k", "$60k"],
            "Year 1": ["$90k", "$72k", "$54k"],
        }
    )

    # 4. CSV File for Download
    fd, csv_path = tempfile.mkstemp(suffix=".csv")
    with os.fdopen(fd, "w") as f:
        pd.DataFrame({"a": [1]}).to_csv(f)

    # 5. Larger Raw Dataframe
    count = 5
    data_df = pd.DataFrame(
        {
            "ID": range(count),
            "Value": np.random.rand(count),
            "URL": ["https://example.com"] * count,
            "Category": ["Equipment"] * count,
        }
    )

    print(summary_df)
    print(data_df)

    return (
        summary_md,
        gr.update(value=summary_df, visible=True),
        gr.update(value=csv_path, visible=True),
        gr.update(value=data_df, visible=True),
    )


with gr.Blocks() as app:
    gr.Markdown("# Gradio Hang Repro")

    with gr.Row():
        with gr.Column(scale=1):
            init_btn = gr.Button("Trigger Hang", variant="primary")
            dl_btn = gr.DownloadButton("Download results", visible=False)

        with gr.Column(scale=3):
            out_md = gr.Markdown("Initial State")
            summary_table = gr.Dataframe(visible=False)

    with gr.Row():
        gr.Markdown("Data Table")
        data_table = gr.Dataframe(visible=False)

    init_btn.click(fn=analyze, outputs=[out_md, summary_table, dl_btn, data_table])

if __name__ == "__main__":
    app.launch(debug=True)

Stack trace in browser

Uncaught (in promise) RangeError: Set maximum size exceeded
    at Set.add (<anonymous>)
    at Batch.ondiscard (index-B0zdmtA4.js:1582:27)
    at svelte_internal_client.js:1235:11
    at update_reaction (index-B0zdmtA4.js:4986:16)
    at update_effect (index-B0zdmtA4.js:5171:18)
    at #traverse_effect_tree (index-B0zdmtA4.js:1361:6)
    at Batch.process (index-B0zdmtA4.js:1281:30)
    at flush_effects (index-B0zdmtA4.js:1698:10)
    at Batch.flush (index-B0zdmtA4.js:1431:4)
    at Batch.revive (index-B0zdmtA4.js:1572:8)

Steps to Reproduce

  1. Run python repro_hang.py.
  2. Open the URL in a browser.
  3. Click "Trigger Hang".
  4. Observe the lack of responsiveness or browser "Page Unresponsive" warning.

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

above

Screenshot

No response

Logs

(nothing really useful)


  Metric Year 0 Year 1
0      A  $100k   $90k
1      B   $80k   $72k
2      C   $60k   $54k
   ID     Value                  URL   Category
0   0  0.567604  https://example.com  Equipment
1   1  0.913717  https://example.com  Equipment
2   2  0.575840  https://example.com  Equipment
3   3  0.981499  https://example.com  Equipment
4   4  0.831259  https://example.com  Equipment

System Info

above

Severity

Blocking usage of gradio

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions