Kevin Bates
0e63ebb1db
Update session_exists() to account for invalid sessions due to culling
...
When kernels are culled, the kernel is terminated in the background,
unbeknownst to the session management. As a result, invalid sessions
can be produced that appear to exist, yet cannot produce a model from
the persisted row due to the associated kernel no longer being active.
Prior to this change, these sessions, when encountered via a subsequent
call to `get_session()`, would be deleted and a KeyError would be raised.
This change updates the existence check to tolerate those kinds of sessions.
It removes such sessions (as would happen previously), but rather than
raise a KeyError when attempting to convert the row to a dictionary,
it logs a warning and returns None, which then allows `session_exists()`
to return False since the session was removed (as was ultimately the
case previously).
Calls to `get_session()` remain just as before and have the potential
to raise `KeyError` in such cases. The difference now being that the
`KeyError` is accompanied by a message indicating the cause.
Fixes #4209
8 years ago
Min RK
962c5ccd80
stop using `@json_handlers`
9 years ago
Min RK
236198571b
test dirs are paths, not TempDir objects
9 years ago
Min RK
8b76de80be
move tz utils to top-level private module ._tz
9 years ago
Min RK
bec396304b
add connections to sessions API tests
9 years ago
Min RK
9f55a857f3
use Z isoformat in UTC timestamps
...
instead of +00:00
9 years ago
Min RK
b472c55d9b
add activity watching to kernels
...
adds to kernel REST model:
- last_activity: datetime-aware timestamp
- execution_state: from last recorded status message
9 years ago
Min RK
8e141df890
run Python tests with a token
...
exercises token auth
9 years ago
Srinivas Reddy Thatiparthy
161c174a98
rename log.warn to log.warning as log.warn is deprecated
9 years ago
Min RK
fe86b65183
json_errors should be outermost decorator on API handlers
...
in order to apply to 403 raised by web.authenticated
10 years ago
Min RK
92d3f4235d
Merge pull request #1359 from blink1073/generic-session
...
Update the session api in preparation for file and console sessions
10 years ago
Scott Sanderson
129f990122
TEST: Use addCleanup in test_sessions_api.
...
This ensures that directories are correctly cleaned up even if tests
fail during setUp.
10 years ago
Scott Sanderson
53ebb068c9
TEST: Use addCleanup in test_sessionmanager.
10 years ago
Steven Silvester
fb8943b676
Check for a directory in get_kernel_path
10 years ago
Steven Silvester
8f8730788d
Clean up the api and update tests
10 years ago
Steven Silvester
06087c2a12
Update sessionmanager tests
10 years ago
Steven Silvester
a4c02561f1
Only give back the notebook path if notebook type
10 years ago
Steven Silvester
3eaa5e426c
Clean up logic
10 years ago
Steven Silvester
197c673585
Clean up logic
10 years ago
Steven Silvester
8c6257bea5
Allow the deprecated session API to work
10 years ago
Steven Silvester
6486b2430f
Update the session model and the tests
10 years ago
Steven Silvester
76d08aca99
Update the session api in preparation for file and console sessions
10 years ago
Min RK
65ba875d5b
allow using sqlite from pysqlite2
...
in case Python was built with an incomplete standard library (missing sqlite3)
we do the same thing in IPython history, etc.
10 years ago
Min RK
1c7bc21ca7
Merge pull request #1237 from blink1073/session-with-kernel-id
...
Allow a session to connect to an existing kernel
10 years ago
Steven Silvester
5b1e0a7d3c
Fall back on new kernel if kernel does note exist
10 years ago
Steven Silvester
59d90f3f72
Remove kernel_id handling temporarily
10 years ago
Steven Silvester
665e7b6c00
Fix handling of kernel_name and kernel_id
10 years ago
Steven Silvester
e449c08e1b
Allow a session to connect to an existing kernel
10 years ago
Steven Silvester
56c653927f
Allow kernel id to take precedence over name
...
Allow kernel id to take precidence over name
Fix spelling
10 years ago
Min RK
23b1beaabc
treat null values as unspecified in session PATCH
10 years ago
Min RK
e9957ddb35
Handle coroutine possibility in test_sessionmanager
10 years ago
Min RK
02d1554f8f
Allow modifying kernel associated with a session via PATCH
...
- PATCH to kernel.id attaches to other kernel
- PATCH to kernel.name starts new kernel with given name
Previous kernel is shutdown after the change
10 years ago
Diego Mesa
482ed8a5a3
updating log.warn to log.warning
10 years ago
Min RK
ba344843eb
add SessionManager.close
...
allows explicit closing, rather than relying on implicit del,
which can run in the wrong thread.
11 years ago
Min RK
cfa64552b2
initialize Application in background thread
...
rather than initializing in main and starting in background, which seemed to cause occasional issues.
Also fix checking for dead notebook, which is no longer a subprocess.
11 years ago
Min RK
9043ae145c
handle async in sessions
...
needed because sessions call kernel methods
11 years ago
Jonathan Frederic
831b2a523b
Merge pull request #472 from minrk/base-url-always-encoded
...
avoid double-encoding base_url
11 years ago
Steven Silvester
88c067ff27
Clean up allowed methods
11 years ago
Min RK
8de725a8de
server-side fixes for double-escaped base_url
11 years ago
Min RK
709ed0d04b
Add APIHandler base class
...
- ensures all API responses are json
- sets CSP to prevent js execution on all API replies
11 years ago
Jason Grout
a016e42cf7
Add links to the REST API documentation (what there is on the wiki)
11 years ago
Min RK
d71a59cc9f
s/jupyter_notebook/notebook
11 years ago