sphinx-contrib / matlabdomain

A Sphinx extension for documenting Matlab code
http://sphinxcontrib-matlabdomain.readthedocs.io/
Other
70 stars 45 forks source link

Is there a reason parallel_read_safe is set to False? #147

Open jdillard opened 2 years ago

jdillard commented 2 years ago

Are there known reasons why parallel_read_safe is set to False as opposed to True, as done in https://github.com/sphinx-contrib/matlabdomain/pull/124? Or was it just the safest option to suppress the warning at the time? If possible, it would be nice to have this extension not block parallel building.

For reference, the PHP domain has their parallel_read_safe set to True.

joeced commented 2 years ago

No, there is no specific reason. I took the safe choice. We could try to see if it's a problem, I can always revert it, if it does not work :). In https://www.sphinx-doc.org/en/master/extdev/index.html#extension-metadata in states that the core logic of the extension should be able to run in parallel. I cannot guarantee this. :(. If we could check or ensure that the data structures cannot be be mixed up, I would say go for it, but until then, no.

jdillard commented 2 years ago

Sounds good. I'll try to experiment with setting parallel_read_safe to True in a fork and report back (only anecdotal evidence, but a start I guess)

zouhairm commented 2 years ago

@jdillard - any updates on running with parallel_read_safe=True ?

jdillard commented 2 years ago

Well the testing didn't go well:

Exception occurred:
File "/path/to/python3.9/site-packages/sphinx/util/parallel.py", line 111, in terminate
  self._result_funcs.pop(tid)
  KeyError: 0

I haven't seen that happen before, and this is the closest related thing I could find based on the error message: https://github.com/sphinx-doc/sphinx/issues/9210

As mentioned before, this is just anecdotal so recommend other people try as well before jumping to any conclusions.