The state management methods added by this commit are a temporary fix to store the user_options attribute in the database, so that it is restored after a hub restart. This is intended to fix an error in the post_stop_hook that cleans the Spark services, since that hook checks user_options to see if the user selected a Spark cluster; if the hub has restarted, those user_options are lost and the hook can't do its job.
The clear_state method is not defined here to clear user_options, since it is invoked when spawning a new user session and it would clear the options that the user specified in the form.
The state management methods added by this commit are a temporary fix to store the user_options attribute in the database, so that it is restored after a hub restart. This is intended to fix an error in the post_stop_hook that cleans the Spark services, since that hook checks user_options to see if the user selected a Spark cluster; if the hub has restarted, those user_options are lost and the hook can't do its job.
To be removed when updating to JupyterHub 2.1.0 or higher, which has a fix: https://github.com/jupyterhub/jupyterhub/pull/3773
The clear_state method is not defined here to clear user_options, since it is invoked when spawning a new user session and it would clear the options that the user specified in the form.