-
-
Notifications
You must be signed in to change notification settings - Fork 55
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
multiprocessing error / segmentation fault #488
Comments
Dear @AlexDo1 , so far I have only seen a segmentation error when installing scipy under mac m1. Edit: I have set up a patch branch with removed threading so that you can install wetterdienst from this branch and run the script another time to test if that works ok? Install via pip install git+https://github.com/earthobservations/wetterdienst.git@patch-threading |
Thank you @gutzbenj , I just re-ran the code in the To Reproduce section above. I have installed wetterdienst via Unfortunately the error remains the same: In [5]: df = request.values.all().df.dropna()
[1] 22368 segmentation fault ipython
/Users/alexd/opt/anaconda3/envs/wetterdienst_single/lib/python3.9/multiprocessing/resource_tracker.py:216: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown
warnings.warn('resource_tracker: There appear to be %d ' |
Dear @AlexDo1,
I still got scipy 1.6.1 running so maybe thats the difference. The libraries I've installed are Package Version aenum 3.1.0 |
I just downgraded scipy to version 1.6.1, nothing has changed in the error. I also executed the sample code in a .py file with the module faulthandler for detailed traceback, this is the output, maybe you can see something in it that could explain the error? python -Xfaulthandler wetterdienst_test
Fatal Python error: Segmentation fault
Thread 0x000000030a8a1000 (most recent call first):
File "/Users/alexd/opt/anaconda3/envs/wetterdienst_single/lib/python3.9/threading.py", line 316 in wait
File "/Users/alexd/opt/anaconda3/envs/wetterdienst_single/lib/python3.9/threading.py", line 574 in wait
File "/Users/alexd/opt/anaconda3/envs/wetterdienst_single/lib/python3.9/site-packages/tqdm/_monitor.py", line 60 in run
File "/Users/alexd/opt/anaconda3/envs/wetterdienst_single/lib/python3.9/threading.py", line 973 in _bootstrap_inner
File "/Users/alexd/opt/anaconda3/envs/wetterdienst_single/lib/python3.9/threading.py", line 930 in _bootstrap
Current thread 0x00000002046d9e00 (most recent call first):
File "/Users/alexd/opt/anaconda3/envs/wetterdienst_single/lib/python3.9/site-packages/dogpile/cache/backends/file.py", line 233 in set_serialized
File "/Users/alexd/opt/anaconda3/envs/wetterdienst_single/lib/python3.9/site-packages/dogpile/cache/region.py", line 1287 in _set_cached_value_to_backend
File "/Users/alexd/opt/anaconda3/envs/wetterdienst_single/lib/python3.9/site-packages/dogpile/cache/region.py", line 1012 in gen_value
File "/Users/alexd/opt/anaconda3/envs/wetterdienst_single/lib/python3.9/site-packages/dogpile/lock.py", line 178 in _enter_create
File "/Users/alexd/opt/anaconda3/envs/wetterdienst_single/lib/python3.9/site-packages/dogpile/lock.py", line 94 in _enter
File "/Users/alexd/opt/anaconda3/envs/wetterdienst_single/lib/python3.9/site-packages/dogpile/lock.py", line 185 in __enter__
File "/Users/alexd/opt/anaconda3/envs/wetterdienst_single/lib/python3.9/site-packages/dogpile/cache/region.py", line 1042 in get_or_create
File "/Users/alexd/opt/anaconda3/envs/wetterdienst_single/lib/python3.9/site-packages/dogpile/cache/region.py", line 1577 in get_or_create_for_user_func
File "/Users/alexd/opt/anaconda3/envs/wetterdienst_single/lib/python3.9/site-packages/decorator.py", line 232 in fun
File "/Users/alexd/opt/anaconda3/envs/wetterdienst_single/lib/python3.9/site-packages/wetterdienst/provider/dwd/observation/download.py", line 48 in _download_climate_observations_data
File "/Users/alexd/opt/anaconda3/envs/wetterdienst_single/lib/python3.9/site-packages/wetterdienst/provider/dwd/observation/download.py", line 27 in <listcomp>
File "/Users/alexd/opt/anaconda3/envs/wetterdienst_single/lib/python3.9/site-packages/wetterdienst/provider/dwd/observation/download.py", line 26 in download_climate_observations_data_parallel
File "/Users/alexd/opt/anaconda3/envs/wetterdienst_single/lib/python3.9/site-packages/wetterdienst/provider/dwd/observation/api.py", line 191 in _collect_station_parameter
File "/Users/alexd/opt/anaconda3/envs/wetterdienst_single/lib/python3.9/site-packages/wetterdienst/core/scalar/values.py", line 437 in query
File "/Users/alexd/opt/anaconda3/envs/wetterdienst_single/lib/python3.9/site-packages/tqdm/std.py", line 1185 in __iter__
File "/Users/alexd/opt/anaconda3/envs/wetterdienst_single/lib/python3.9/site-packages/wetterdienst/core/scalar/values.py", line 708 in all
File "/Users/alexd/Desktop/wetterdienst_test", line 14 in <module>
[1] 25055 segmentation fault python -Xfaulthandler wetterdienst_test
/Users/alexd/opt/anaconda3/envs/wetterdienst_single/lib/python3.9/multiprocessing/resource_tracker.py:216: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown
warnings.warn('resource_tracker: There appear to be %d ' |
Alright, so the error once again seems to be related to the current caching implementation by dogpile.cache. Unfortunately we've seen many problems with this and currently try to use another filecache looking at #431 . At this moment the only fix is to delete the cache. You will find the wetterdienst show Delete this folder and try running the code one more time, please. |
I deleted the cache folder and the code now runs without errors. Thank you so much for helping me (especially on a Sunday noon). |
PS: If at some point you need someone to test the new caching implementation on M1, feel free to contact me. |
Hi Alex, thank you for reporting your observations. Please note, following the rationale by @meteoDaniel at #417, Wetterdienst honors the While I see the good intentions of #489 by @gutzbenj, I believe it is misguided because the culprit for the flaws when concurrently downloading remote resources is not the parallelization on the acquisition side of things, but rather the unsafety of the dbmfile-based cache implementation when accessed concurrently. As such, I believe using
On #431 (branch With kind regards, |
Hello Andreas, your solution works very well. I only had to delete the wetterdienst cache folder by hand, by setting Thanks again! |
Describe the bug
Hi, I would like to use the package wetterdienst to load data from the DWD server into my Jupyter notebook.
For the first few days, downloading the data worked fine (with
UnplickingErrors
for some parameter-resolution constellations). Since a few days my python kernel crashes every time I try to extract the values from a DwdObservationRequest.If just running the example code from your documentation in an ipython console, the kernel crashes with a
segmentation fault / multprocessing error
when I extract the values withdf = request.values.all().df.dropna()
.The strange thing is that the package worked for the first few days until the error suddenly appeared.
To Reproduce
This is the example code from the documentation executed in an ipython console:
Expected behavior
The data for the station 'Rheinstetten' and parameter and resolution specified in
DwdObservationRequest
should be downloaded and saved todf
.Desktop:
Additional context
Do you already now about this bug?
A possible solution to this problem could be to use the package single threaded, if that is possible.
The text was updated successfully, but these errors were encountered: