Opened 16 years ago

Closed 15 years ago

#2 closed enhancement (fixed)

Notebook locking

Reported by: wstein@… Owned by: boothby
Priority: major Milestone:
Component: notebook Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges


Currently it is possible to run two SAGE notebooks on the same directory, which is potentially VERY VERY bad. It would be better if when a SAGE notebook server starts up it checks for the presence of a lock file. This file would contain the pid of a running SAGE notebook process -- if the file and that process exist, then the notebook won't start. When the notebook finishes it should delete that lock file.

Change History (5)

comment:1 Changed 16 years ago by justin@…

A thought: PIDs live in a fairly small space, so it might be worth doing some kind of check to verify that the process corresponding to the PID is a SAGE notebook process.

Alternate approach: instead of just bailing, ask the user whether to continue (and remove the existing lock file), or quit. That puts the burden on the user instead of the programmer, but the results may be better.

comment:2 in reply to: ↑ description ; follow-up: Changed 16 years ago by boothby

Rather than keep a PID, a more robust solution would be to write the URL to the notebook in the lockfile. Upon startup, the server would send a request to that URL -- if there's already a running server, just return.

If we also stored the PID, we could attempt to kill nonresponsive servers.

comment:3 in reply to: ↑ 2 Changed 16 years ago by nbruin

One could end up with an NFS filesystem and notebooks running on distinct machines. If the port listened on is only a local one on machine A then sending a request from machine B will not confirm that the process is still running.

This is a bad thing to happen, but not unlikely if someone has sage installed in their homedir and moves from machine A to machine B.

comment:4 Changed 15 years ago by mabshoff

  • Component changed from basic arithmetic to notebook
  • Owner changed from somebody to boothby

comment:5 Changed 15 years ago by was

  • Resolution set to fixed
  • Status changed from new to closed

This was fixed decades ago!

Note: See TracTickets for help on using tickets.