File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -253,6 +253,11 @@ async def _initialize_process_based_on_os_type(cmd, env):
253
253
return await asyncio .create_subprocess_exec (
254
254
* cmd ,
255
255
env = env ,
256
+ # kernel sporadically ends up cleaning the child matlab-proxy process during the
257
+ # restart workflow. This is a workaround to handle that race condition which leads
258
+ # to starting matlab-proxy in a new process group and is not counted for deletion.
259
+ # https://github.com/ipython/ipykernel/blob/main/ipykernel/kernelbase.py#L1283
260
+ start_new_session = True ,
256
261
)
257
262
except Exception as e :
258
263
log .error ("Failed to create posix subprocess: %s" , e )
Original file line number Diff line number Diff line change @@ -153,15 +153,15 @@ def _are_orphaned_servers_deleted(predicate: Optional[str] = "") -> bool:
153
153
servers : dict = storage .get_all ()
154
154
155
155
def _matches_predicate (filename : str ) -> bool :
156
- return filename .split ("_" )[0 ] == predicate
156
+ return filename .split ("_" )[0 ] == str ( predicate )
157
157
158
158
# Checks only a subset of servers (that matches the parent_pid of the caller)
159
159
# to reduce the MATLAB proxy startup time
160
160
if predicate :
161
161
servers = {
162
162
filename : server
163
163
for filename , server in servers .items ()
164
- if _matches_predicate (filename )
164
+ if _matches_predicate (Path ( filename ). stem )
165
165
}
166
166
if not servers :
167
167
log .debug ("Parent pid not matched, nothing to cleanup" )
You can’t perform that action at this time.
0 commit comments