Skip to content

Ability to completely disable any use of multiprocessing.Queue in Xule? #34

Description

@jonathanflittle

I'm trying to run Arelle and the Xule plugin in an AWS Lambda function. Part of that environment's limitation is that it does not support /dev/shm, which is required for Python's multiprocessing.Queue to function. For the Xule plugin in Arelle, this ends up being a FileNotFoundError when the XuleGlobalContext attempts to create the rules_queue.

There is already a check in the XuleMessageQueue that prevents the use of multiprocessing.Queue in that class without the --xule-multi command line argument. I'm wondering if the rules_queue of the XuleGlobalContext could also check the --xule-multi argument before trying to use the multiprocessing.Queue, and fall back to using queue.Queue if it is not set? I've done some testing on using Queue instead of M_Queue for the rules_queue and it works for my purposes so far, but I'm unsure of what other side effects it has based on the different ways M_Queue vs. Queue provide objects to the consumer (serialized copies vs. direct references.)

Here's the error when trying to use the M_Queue as the internal Python code attempts to create a SemLock. (Unsupported on AWS Lambda.)

Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/cx_Freeze/initscripts/__startup__.py", line 140, in run
File "/usr/local/lib/python3.12/site-packages/cx_Freeze/initscripts/console.py", line 25, in run
File "arelleCmdLine.py", line 46, in
File "/build/arelle/CntlrCmdLine.py", line 61, in main
File "/build/arelle/CntlrCmdLine.py", line 73, in parseAndRun
File "/build/arelle/CntlrCmdLine.py", line 554, in configAndRunCntlr
File "/build/arelle/CntlrCmdLine.py", line 1088, in run
File "/usr/local/arelle/plugin/xodel/__init__.py", line 111, in cmdLineXbrlLoaded
process_xodel(cntlr, options, modelXbrl)
File "/usr/local/arelle/plugin/xodel/xodel.py", line 175, in process_xodel
log_capture = run_xule(cntlr, options, modelXbrl)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/arelle/plugin/xodel/xodel.py", line 219, in run_xule
call_xule_method(cntlr, modelXbrl, options.xule_rule_set, run_options)
File "/usr/local/arelle/plugin/xule/__init__.py", line 970, in callXuleProcessor
used_taxonomies = process_xule(rule_set,
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/arelle/plugin/xule/XuleProcessor.py", line 75, in process_xule
global_context = XuleGlobalContext(rule_set, model_xbrl, cntlr, options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/arelle/plugin/xule/XuleContext.py", line 234, in __init__
self.rules_queue = M_Queue()
^^^^^^^^^
File "/usr/local/lib/python3.12/multiprocessing/context.py", line 103, in Queue
File "/usr/local/lib/python3.12/multiprocessing/queues.py", line 43, in __init__
File "/usr/local/lib/python3.12/multiprocessing/context.py", line 68, in Lock
File "/usr/local/lib/python3.12/multiprocessing/synchronize.py", line 169, in __init__
File "/usr/local/lib/python3.12/multiprocessing/synchronize.py", line 57, in __init__
FileNotFoundError: [Errno 2] No such file or directory
Activation of plug-in Xince and Xodel successful, version 1.0. - xodel
Xule version: 3.0.30024 -

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions