New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error handling for connection refused when attempting to use dashboard #68
Comments
Thnx for the kind words! :) In your situation, the dashboard in one container hasn't started yet, but the other process already wants to connect. Is that a correct summary of your race condition? The change you suggest sounds good to me. And let's definitely throw a warning if that happens. Is your error triggered in |
Correct. There have been cases where the dashboard did start up in time but the connection between containers failed. I want to chalk it up to docker networking but I'm still troubleshooting. As I mentioned, the quick fix will be to throw a warning that the dashboard did not connect properly. We can even add a flag to force a connection if you think that would be helpful too |
Adding a flag would be a useful addition, indeed. I'm currently busy with some architectural changes in mpire. This will take a while to finish, so I can't work on this one in the near feature (few weeks). If you don't mind waiting, I'll integrate it with that release when I'm done. Otherwise, feel free to make a PR yourself in the mean time. |
I want to go about it a bit differently. If you want to use a dashboard you will have to call I want to change this such that this function will also check if it can establish a connection. If not, it will raise Is this a good solution for you as well? |
* Added the apply and apply_async functions (Fixes #63) * When inside a Jupyter notebook, the progress bar will not automatically switch to a widget anymore. tqdm cannot always determine with certainty that someone is in a notebook or, e.g., a Jupyter console. Another reason is to avoid the many errors people get when having widgets or javascript disabled (Fixes #71) * The dashboard.connect_to_dashboard function now raises a ConnectionRefused error when the dashboard isn't running, instead of silently failing and deadlocking the next map call with a progress bar (Fixes #68) * Added support for a progress bar without knowing the size of the iterable. It used to disable the progress bar when the size was unknown * Changed how max_tasks_active is handled. It now applies to the number of tasks that are currently being processed, instead of the number of chunks of tasks, as you would expect from the name. Previously, when the chunk size was set to anything other than 1, the number of active tasks could be higher than max_tasks_active * Updated some exception messages and docs (Fixes #69) * Changed how worker results, restarts, timeouts, unexpected deaths, and exceptions are handled. They are now handled by individual threads such that the main thread is more responsive. The API is the same, so no user changes are needed * Mixing multiple map calls now raises an error (see docs) * Fixed a bug where calling a map function with a progress bar multiple times in a row didn't display the progress bar correctly * Fixed a bug where the dashboard didn't show an error when an exit function raised an exception --------- Co-authored-by: sybrenjansen <sybren.jansen@gmail.com>
Released in v2.7.0 |
I want to start by saying this repository is sweet! Really love what you did here and we have been using this extensively for a lot of our operations
I have been dealing with a race condition that occurs when a dashboard is running in another container, and a process in a different container attempts to connect to it. I see the ConnectionRefused error which destroys the pipeline.
I've attempted to handle the error outside the scope of the package with no luck. Would it be possible to add a flag or handle the error in the package itself?
So if a connection attempt is made and fails, the multiprocessing pipeline continues without updating the pbar in the browser. We could also throw a warning
Let me know if I can help with this!
The text was updated successfully, but these errors were encountered: