domainaware / checkdmarc

A parser for SPF and DMARC DNS records
https://domainaware.github.io/checkdmarc
Apache License 2.0
245 stars 76 forks source link

Use thread-safe timeout-decorator #49

Closed x-way closed 4 years ago

x-way commented 4 years ago

When using the checkdmarc module not in the main thread, the (default) implementation of timeout-decorator using signals does not work and fails with an exception.

This change uses the multiprocessing capable implementation of timeout-decorator, so that the checkdmarc module can also be used outside the main thread.

See https://pypi.org/project/timeout-decorator/#multithreading

seanthegeek commented 4 years ago

Unfortunately, I cannot accept this change, because it would break Windows support.

Make sure that in case of multiprocessing strategy for timeout, your function does not return objects which cannot be pickled, otherwise it will fail at marshalling it between master and child processes.

https://github.com/uqfoundation/dill/issues/308

https://github.com/bitranox/wrapt_timeout_decorator/issues/10

MrKragh commented 8 months ago

This is now some years ago. Do you know if this still is an issue on Windows? I'm currently using this on an Azure Function App that are failing due to being threaded. Have forked it for now, but would love to find a solution making me able to follow this project. Thanks!