run_lambda icon indicating copy to clipboard operation
run_lambda copied to clipboard

Doesn't work on Windows

Open nascif opened this issue 8 years ago • 1 comments

I tried this tool on Windows and got the following stack trace:

Traceback (most recent call last): File "c:\home\bin\anaconda2\envs\py3\lib\runpy.py", line 184, in run_module_as_main "main", mod_spec) File "c:\home\bin\anaconda2\envs\py3\lib\runpy.py", line 85, in run_code exec(code, run_globals) File "C:\home\bin\Anaconda2\envs\py3\Scripts\run_lambda.exe_main.py", line 9, in File "c:\home\bin\anaconda2\envs\py3\lib\site-packages\run_lambda_main.py", line 61, in main timeout_in_seconds=args.timeout) File "c:\home\bin\anaconda2\envs\py3\lib\site-packages\run_lambda\call.py", line 53, in run_lambda signal.alarm(0) # disable any pending alarms AttributeError: module 'signal' has no attribute 'alarm'

Seems to be related to https://github.com/natekupp/ffx/issues/17, which unfortunately was closed without being addressed.

nascif avatar Aug 29 '17 15:08 nascif

As far as I can see, the multiprocessing library is the only way I can think to support Windows, while retaining timeout functionality. Unfortunately, this has some downsides:

  • Much harder to estimate memory usage of calls
  • Additional overhead of spawning a new process for each call. This could slow down a large suite of unit tests
  • Running the lambda function in a separate process would have some noticeable repercussions (e.g. updates to global variables inside the handler function would have no effect from the parent process's perspective)

That said, I may be missing something. If you have any other suggestions for how to make run_lambda Windows-compatible, I would be happy to hear them.

ethantkoenig avatar Aug 30 '17 05:08 ethantkoenig