Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Request Queue Size Unbounded #27

Closed
ajspeck opened this issue Oct 18, 2017 · 5 comments
Closed

Request Queue Size Unbounded #27

ajspeck opened this issue Oct 18, 2017 · 5 comments

Comments

@ajspeck
Copy link

ajspeck commented Oct 18, 2017

The changes in #22 cause the request queue to continuously grow as new updates come in since old requests are only marked as rejected and not removed from the list. Once this array reaches a couple of hundred items long, I see Chrome and Firefox slow to a crawl. Note the growth of the array is easily visible in the SET_REQUEST_QUEUE action logged in the browser console. For my app this occurs in a couple of seconds given the number of updates being made.

Adding this:

                    dispatch(setRequestQueue(
                        reject(
                            rejected => rejected,
                            getState().requestQueue	
                        )
                    )); 

to the updateRequestQueue function

const updateRequestQueue = rejected => {
const postRequestQueue = getState().requestQueue
const thisRequestIndex = getThisRequestIndex();
const updatedQueue = adjust(
merge(__, {
status: res.status,
responseTime: Date.now(),
rejected
}),
thisRequestIndex,
postRequestQueue
);
dispatch(setRequestQueue(updatedQueue));
}

fixed the performance issue I saw but it is not clear that this is the best solution.

@chriddyp
Copy link
Member

Thanks for reporting! I'll look into this today.

@chriddyp
Copy link
Member

@ajspeck - I've pushed up a preliminary fix in the prerelease channel. Could you try it out with:

pip install dash-renderer==0.12.0rc2

This will fix the boundless requestQueue issue. You can examine the requestQueue yourself by opening up your browser's console and typing store.getState().requestQueue. I'm curious to see if this fixes your performance issues.

Thanks!!

@ajspeck
Copy link
Author

ajspeck commented Oct 19, 2017

The updated version fixes the performance issues I saw before. Watching the requestQueue size over 30 minutes, I saw it stayed fixed at around 40 items with none of the growth I saw before. Thanks for getting this fixed quickly.

@chriddyp
Copy link
Member

Thank you @ajspeck ! I'll work on getting this into the stable branch soon. In the meantime, it should be "safe" for you to use this prerelease channel.

@chriddyp
Copy link
Member

Fixed in #28 and available in a stable channel at dash-renderer==0.11.1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants