Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport #52754 into 2017.7.9 #53071

Merged
merged 3 commits into from
May 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion salt/log/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -812,13 +812,17 @@ def setup_extended_logging(opts):

def get_multiprocessing_logging_queue():
global __MP_LOGGING_QUEUE
from salt.utils import is_darwin

if __MP_IN_MAINPROCESS is False:
# We're not in the MainProcess, return! No Queue shall be instantiated
return __MP_LOGGING_QUEUE

if __MP_LOGGING_QUEUE is None:
__MP_LOGGING_QUEUE = multiprocessing.Queue(100000)
if is_darwin():
__MP_LOGGING_QUEUE = multiprocessing.Queue(32767)
else:
__MP_LOGGING_QUEUE = multiprocessing.Queue(100000)
return __MP_LOGGING_QUEUE


Expand Down
8 changes: 6 additions & 2 deletions tests/integration/files/log_handlers/runtests_log_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
import msgpack

# Import Salt libs
import salt.ext.six as six
from salt.ext import six
from salt.utils import is_darwin
import salt.log.setup

log = logging.getLogger(__name__)
Expand Down Expand Up @@ -60,7 +61,10 @@ def setup_handlers():
# Above that value, if `process_queue` can't process fast enough,
# start dropping. This will contain a memory leak in case `process_queue`
# can't process fast enough of in case it can't deliver the log records at all.
queue_size = 10000000
if is_darwin():
queue_size = 32767
else:
queue_size = 10000000
queue = Queue(queue_size)
handler = salt.log.setup.QueueHandler(queue)
level = salt.log.setup.LOG_LEVELS[(__opts__.get('runtests_log_level') or 'error').lower()]
Expand Down