public inbox for
 help / color / mirror / Atom feed
* "multiple" users of a SN project & a bug report
@ 2001-07-15 18:47 David Taylor
  2001-07-16 11:04 ` Mo DeJong
  0 siblings, 1 reply; 2+ messages in thread
From: David Taylor @ 2001-07-15 18:47 UTC (permalink / raw)
  To: sourcenav

From looking at the code and reading some of the archives of this
mailing list, I conclude that it isn't intended for a SN project to be
allowed to be open in two or more processes simultaneously -- which is
a real shame!

For instance, I'd like to be able to

. bring up SN at work
. open a project
. go home (without closing the project)
. login to work from home
. bring up SN from home
. open the project that I have open at work

Having the second one say "it's already open for modification, you
have to open it read-only", might not be too bad.  Right now though it
totally refuses to open it.

[At least in SN 5.0; I tried the snapshot dated April 12th, but it
failed to build for me on Red Hat Linux 6.2.]

NOTE: there *IS* a bug in the function sn_is_project_busy

Assuming we are on unix, ignore the issue of root opening the project,
and we have a real project, the remaining logic in sn_is_project_busy
reduces to roughly:

. open the project read-only; get list of users; close the project

. if no one is using the project, return ""

. if the project user is on the same machine, then
    . if the pid matches our's, return "me"
    . if the platform is "unix"
        . if the process no longer exists OR is owned by someone else,
          then return "" <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< BUG

	  (you fail to distinguish between failure due to the process
           not existing [ESRCH] versus you don't have permission to send
	   the signal to that process [EPERM].)

    . else ...

. if project user matches current user, return "me"

. return "busy"


. if two users, same or different, on different machines try to open
  the same project, the second one will fail

. if the same user, tries to open the same project twice on the same
  machine, the second attempt will fail

. if different users try to open the same project on the same machine,
  the second one will succeed!

[Additionally, there appears to be a race condition present -- two
processes could open the project read-only, check whether there are
current users, see that there are none, and go ahead and re-open

Take care,

David Taylor

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-07-16 11:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-15 18:47 "multiple" users of a SN project & a bug report David Taylor
2001-07-16 11:04 ` Mo DeJong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).