Skip to content

Commit

Permalink
clnrest: Change process method to fork
Browse files Browse the repository at this point in the history
On mac the clnrest plugin hangs on log messages, causing it to never run.

This guide suggests switching to fork’ing instead of spwan’ing
https://superfastpython.com/multiprocessing-common-errors/#Error_2_print_Does_Not_Work_In_Child_Processes

Switching to fork fixes the hang on Mac.

Changelog-None
  • Loading branch information
ddustin authored and rustyrussell committed Aug 24, 2023
1 parent 98ad467 commit 8d5be61
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions plugins/clnrest/clnrest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import sys
import os
import time
import multiprocessing
from gunicorn import glogging # noqa: F401
from gunicorn.workers import sync # noqa: F401

Expand All @@ -26,6 +27,7 @@
'result': {'disable': str(err)}}))
sys.exit(1)

multiprocessing.set_start_method('fork')

jobs = {}
app = Flask(__name__)
Expand Down

0 comments on commit 8d5be61

Please sign in to comment.