Add exclude_last_activity_patterns to prevent some requests from keeping server alive - #609
Add exclude_last_activity_patterns to prevent some requests from keeping server alive#609minrk wants to merge 6 commits into
Conversation
allows for excluding certain endpoints from activity that might keep the server alive even when it's really idle. and allow update_last_activity to be a callable
|
this is great @minrk! thanks so much! |
ryanlovett
left a comment
There was a problem hiding this comment.
This will be a useful feature, thanks! A couple comments:
- In order for downstream proxies to be able to set
exclude_last_activity_patternsin their configs (like in the draft PR to jupyter-rsession-proxy), it needs to be a ServerProcess traitlet. I think it should be added toconfig.pyas a traitlet and then passed through inget_proxy_attributes. - Should it be documented that when one sets a callable for
update_last_activity, it will causeexclude_last_activity_patternsto be ignored? - Maybe tests can be added in a later PR.
and properly expose exclude_last_activity_patterns via config
|
Added tests and fixed propagation from config, including docstrings explaining that callable |
iso date strings are already sortable without parsing (assuming consistent timezone)
|
Thanks, looks good. The |
already guaranteed in config
|
yeah, should be redundant if we can assume the list always comes via validated config. It is definitely a no-op, |
|
tests seem to have become flaky, some due to waiting for proxy processes to start on Windows, and some of the unix socket tests occasionally failing with ECONNREFUSED. Not sure what's going on there |
|
ok, tests passing after a re-run |
allows for excluding certain endpoints from activity that might keep the server alive even when it's really idle.
and allow update_last_activity to be a callable
Checklist
What does this PR do?
Type of change:
Is this PR related to an issue, or is it part of a larger body of work?
Does this PR introduce a breaking change?
How can this PR be tested?
set
exclude_last_activity_patternsand submit requests. last_activity should not be updated.What should a reviewer concentrate their feedback on?
if this is adequate configuration, or if it should be expressed differently
Other information
cc @shaneknapp who's dealing with lots of idle rstudio sessions not being culled due to constant
POST /rstudio/events/get_eventsI'll do another PR against rsession-proxy to ignore get_events by default