plotly / plotly/dash

requestQueue get stuck when browser is experiencing intensive navigation

Open
#992 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Thank you so much for helping improve the quality of Dash!

We do our best to catch bugs during the release process, but we rely on your help to find the ones that slip through.

Describe your context
Please provide us your environment so we can easily reproduce the issue.

  • replace the result of pip list | grep dash below
dash                            1.5.1     
dash-auth                       1.2.0
dash-bio                        0.1.4
dash-bio-utils                  0.0.3rc3
dash-canvas                     0.0.11
dash-core-components            1.4.0
dash-cytoscape                  0.0.5
dash-dangerously-set-inner-html 0.0.2
dash-daq                        0.2.1
dash-flow-example               0.0.5
dash-html-components            1.0.1
dash-renderer                   1.2.0
dash-table                      4.5.0
plotly                          3.3.0
  • if frontend related, tell us your Browser, Version and OS

    • OS: [Mac OS]
    • Browser [Chrome]
    • Version [77]

Describe the bug

This is kind of reproducible with the current dash-docs PR for 1.5.1 upgrade, but we don't have fixed steps to reproduce it each time.

To give a little background about issue. We introduced a new feature/parameter in the visit_and_snapshot API, what it does is to detect if window.store exists and makes sure all
the callbacks get fired and have a responseTime in the queue (refer to https://github.com/plotly/dash/blob/b3b9de9923d82ff1281889b3695d638e95bb1590/dash/testing/dash_page.py#L43-L48)

this mechanism works fine with the older dash version prior to the 1.5.x release. so the behavior is new. what I observed is that the tests in test_component.py are doing intensively url navigation in the browser, it basically goes through each sub section of dash docs in a very fast way, at some point, the request will get stuck with status = 'loading', a refresh of the page might solve the issue, but not always the case. the stuck point is always consistent on CircleCI and in a local setup. but not the same in the these two environments: i.e. circleci get stuck with /datatables/callbacks while local run might be /datatables/editable

this looks like a leak or something related to the recent async work

sample of a loading state https://circleci.com/api/v1.1/project/github/plotly/dash-docs/8326/output/106/0?file=true
DEBUG dash.testing.dash_page:dash_page.py:48 status of state rq [{u'status': 200, u'requestTime': 1572637143419, u'uid': u'ba5537d0-617e-8488-94b8-0743ae70833e', u'controllerId': u'chapter.children', u'rejected': False, u'responseTime': 1572637143451}, {u'status': 200, u'requestTime': 1572637143564, u'uid': u'ffd418a2-6583-0b41-68e1-f87978e29b89', u'controllerId': u'datatable-paging.data', u'rejected': False, u'responseTime': 1572637144000}, {u'status': 200, u'requestTime': 1572637143625, u'uid': u'00824a87-cc96-bd10-14e8-47c488901e4f', u'controllerId': u'table-paging-with-graph.data', u'rejected': False, u'responseTime': 1572637144090}, {u'status': u'loading', u'controllerId': u'table-sorting-filtering.data', u'uid': u'2dd02b0a-e358-ac9f-24c1-66289dbd0643', u'requestTime': 1572637143676}, {u'status': u'loading', u'controllerId': u'table-filtering.data', u'uid': u'511a97fc-603d-7a33-49dd-343365d2e978', u'requestTime': 1572637143719}, {u'status': u'loading', u'controllerId': u'table-paging-and-sorting.data', u'uid': u'4680495b-ed49-5470-089c-cc8927d40451', u'requestTime': 1572637143766}, {u'status': u'loading', u'controllerId': u'datatable-paging-page-count.data', u'uid': u'0f143cab-e84b-05bb-befb-05d20eb61c83', u'requestTime': 1572637143824}, {u'status': u'loading', u'controllerId': u'datatable-paging-page-count.page_count', u'uid': u'cdfd9b8e-5619-35d0-a1a3-f4a844dc8f92', u'requestTime': 1572637143872}, {u'status': u'loading', u'controllerId': u'table-multicol-sorting.data', u'uid': u'e086324e-52c1-44ac-aeae-84f308e2508b', u'requestTime': 1572637143918}, {u'status': 200, u'requestTime': 1572637144762, u'uid': u'd85d3baf-7a61-d324-b09a-6c7efc6485c0', u'controllerId': u'table-paging-with-graph-container.children', u'rejected': False, u'responseTime': 1572637145068}]

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

Start with test_component.py and the visit_and_snapshot logic in dash/testing/dash_page.py around lines 43-48. Run the component tests with intensive URL navigation and inspect the request queue states, especially requests that remain loading. Done means the tests complete reliably without callbacks being left in the loading state.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.