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

Python logging module does not work from engines #161

Closed
slishak opened this issue Jun 29, 2016 · 2 comments
Closed

Python logging module does not work from engines #161

slishak opened this issue Jun 29, 2016 · 2 comments

Comments

@slishak
Copy link

slishak commented Jun 29, 2016

Using a custom handler in the logging module can cause an engine to hang indefinitely. I think this behaviour has not always existed, as it only started happening when I updated to the latest releases of IPython/Jupyter/ipyparallel. I believe it could be related to jupyter/notebook#1397.

If I have module loggingtest.py as follows:

import logging
import sys

hPrint = logging.StreamHandler(sys.stdout)
logger = logging.Logger('Logger')
logger.addHandler(hPrint)  # commenting out this line fixes the bug
logger.log(1, 'Log initialised')  # engine will hang on this line

def log(message):
    logger.log(1, message)

And then I start a cluster using ipcluster start -n 2 and connect to it using c = ipyparallel.Client(), importing that module will hang indefinitely with either of the following methods:

out = c[0].execute('import loggingtest')
out.wait(timeout=5)
import loggingtest
out = c[1].apply_async(loggingtest.log, 'test')
out.wait(timeout=5)

I'm using Windows 7, Python 2.7.10 32-bit, all IPython modules up to date:

ipykernel (4.3.1)
ipyparallel (5.1.1)
ipython (4.2.0)
ipython-genutils (0.1.0)
ipywidgets (5.1.5)
jupyter (1.0.0)
jupyter-client (4.3.0)
jupyter-console (4.1.1)
jupyter-core (4.1.0)
nbconvert (4.2.0)
nbformat (4.0.1)
notebook (4.2.1)
@slishak
Copy link
Author

slishak commented Jun 29, 2016

Probably also related to https://github.com/jupyter/tmp_for_org_transfer/issues/1

@minrk
Copy link
Member

minrk commented Jun 2, 2021

Hi! I’m going through and cleaning up old/stale issues on this repo. It looks like this issue is resolved (running the same does not reproduce the error with current versions). Feel free to open a new Issue if you are still having this trouble.

@minrk minrk closed this as completed Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants