holoviz / panel

Panel: The powerful data exploration & web app framework for Python
https://panel.holoviz.org
BSD 3-Clause "New" or "Revised" License
4.62k stars 504 forks source link

panel serve logs stops working when importing datashader #2302

Open hoxbro opened 3 years ago

hoxbro commented 3 years ago

ALL software version info

Windows 10 20H2 holoviews 1.14.3 panel 0.11.3 datashader 0.12.1

Description of expected behavior and the observed behavior

I'm not sure if this a panel, datashader, or a holoviews issue. The problem is when importing holoviews.operation.datashader in my file, the logging in the command window stops sending logs. When runningpanel serve tmp.py --autoreload with holoviews.operation.datashader imported no logs show up at all and I have to guess when ready.

Complete, minimal, self-contained example code that reproduces the issue

import panel as pn
import holoviews.operation.datashader

pn.panel("# Test").servable()

And run the command panel serve or panel serve --autoreload

Screenshots or screencasts of the bug in action

No datashade import datashade import
Without --autoreload 2021-05-09 17_02_50 2021-05-09 17_05_44
With --autoreload 2021-05-09 17_04_59 2021-05-09 17_06_36
hoxbro commented 3 years ago

I don't know if it is related to this problem, but I'm have been seeing error message for memory leaks when having datashader imported.

bokeh.document.document - ERROR - Module <module 'bokeh_app_2c6de2e007084afdb776cc94fdd6bb90' from 'C:\\Users\\shh\\Desktop\\tmp.py'> has extra unexpected referrers! This could indicate a serious memory leak. Extra referrers: [<cell at 0x000001A0C462DD38: module object at 0x000001A0C466B958>]

I can somewhat force this error, but I don't know why.

https://user-images.githubusercontent.com/19758978/117578527-13281b80-b0ef-11eb-9870-bc0441d05b14.mp4

hoxbro commented 3 years ago

This missing logging is related to dask.distributed as I see the same behavior with this code:

import panel as pn
import dask.distributed

pn.panel("# Test").servable()

If I comment out this line everything seem to work as without the dask.distributed import. https://github.com/dask/distributed/blob/7e10875528d955947340f6f95da54f6919bdd815/distributed/config.py#L79

philippjfr commented 3 years ago

I fixed this once upon a time https://github.com/dask/distributed/pull/3087 :/

jbednar commented 3 years ago

@Hoxbro, do you still see it with a version of Dask distributed that includes @philippjfr's fix?

philippjfr commented 3 years ago

Yes that fix is very old, seems to have regressed again a while ago.