Open ajstewart opened 1 week ago
There looks to be a disconnect between the naming for schedule_task
and cancel_task
in panel/io/state.py
In schedule_task
the task name is prepended with the PID
https://github.com/holoviz/panel/blob/8421976315af703933e634b7180476a459a16ca1/panel/io/state.py#L857-L870
However in cancel_task
it assumes that the name given exactly matches the task to remove. So without the PID, it assumes the task doesn't exist and probably raises a KeyError
https://github.com/holoviz/panel/blob/8421976315af703933e634b7180476a459a16ca1/panel/io/state.py#L575-L591
To fix, you would probably need to add the PID to the call in the auth.py
to match how the task is created, or update the cancel_task
function to always add the PID to the task name being cancelled
@sblowers, thank you for the investigation!
This is an oversight. Can you submit a PR with your suggested change in cancel_task
?
ALL software version info
(this library, plus any other relevant software, e.g. bokeh, python, notebook, OS, browser, etc should be added within the dropdown below.)
Software Version Info
```plaintext bokeh 3.6.1 panel 1.5.3 macOS 15.0.1 ```Description of expected behavior and the observed behavior
It's hard to come up with a reproducible example as it's related to auth, but recently I've started to see this following warning when a user refreshes their session or logs on again
I am using a generic auth type with an Azure B2C setup.
I'm reporting this because as far I can see the task is actually attempted to be canceled before creating the new one:
https://github.com/holoviz/panel/blob/e24f44342908b33bf38ab0c4c3e784d50063034a/panel/auth.py#L1133-L1140
I'm not sure where the number comes from in the task name, it seems to be attached to the user.
I don't think this is harming anything to do with the app, but it seems unexpected given the code above.
I am running the app via the CLI:
panel serve src/app.py --autoreload --static-dirs assets=./src/assets --port 5006 --setup src/app_setup.py
Complete, minimal, self-contained example code that reproduces the issue
Stack traceback and/or browser JavaScript console output
Screenshots or screencasts of the bug in action