Re: [vchkpw] concurrency

2006-07-09 Thread jhq

Hello Michael,


As for (2), there may be a chance of conflict in theory, because vpop
commands do not implement the mechanism to avoid the concurrent access.
But, in the real world, it is the rare case that the same folder is
created/deleted at the same time.

When would you create a user and delete them at the exact same time?  
Either the user exists or doesn't.  Whatever state you end up in is 
probably sane, and odds are you won't do multiple actions as each depend 
on the opposite state.

...


Thank you for your detailed explanation.
In the DB world, the concept of transaction is essential.
But, as you pointed, it is not true for vpop commands.

Jun


Re: [vchkpw] concurrency

2006-07-08 Thread jhq

Hello Michael,

In theory, ther'es always potential, particularly when dealing with 
files on disk.  One program could in theory do one thing and not

another.

The MySQL database should deal with its own concurrency.  The CDB 
database has .vpasswd.lock files when updating the password files.


You probably don't have to worry about corrupting anything, but in 
theory one could get system time and do something unexpected on the 
other, particularly in deleting and creating folders.  That's usually

 not that important.  Odds are that's never going to happen that you
do two opposite actions on the same [EMAIL PROTECTED] at the same time.

Odds are, you won't cause any harm.


Thank you for your help.
I've been thinking about what you said ...

The vpop commands will
1) Insert/Update/Delete the record in SQL table (such as MySQL)
   or CDB file
2) Create/Update/Delete the folder/file on the local file system.
I don't know the order, but it will not matter.

As for (1), SQL database and CDB have their own mechanism to serialize 
the concurrent access, so we will not worry about it.


As for (2), there may be a chance of conflict in theory, because vpop 
commands do not implement the mechanism to avoid the concurrent access.
But, in the real world, it is the rare case that the same folder is 
created/deleted at the same time.

For example, at the time when someone is creating
   /home/vpopmail/domains/foo.com/tom
there will be nobody to delete it.

So, we need not to worry about the concurrent usage of vpop commands.
Is my understanding correct?

Have a nice weekend.

Jun


Re: [vchkpw] concurrency

2006-07-08 Thread Michael Krieger
[EMAIL PROTECTED] wrote:As for (1), SQL database and CDB have their own mechanism to serialize the concurrent access, so we will not worry about it.Well SQL has its own locking, be it table or row level that will prevent a single domain from being updated at the same time. For example, an update and a delete will either update and then delete, or delete and then fail on an update. Either way, it does the right thing.As for (2), there may be a chance of conflict in theory, because vpop commands do not implement the mechanism to avoid the concurrent access.But, in the real world, it is the rare case that the same folder is created/deleted at the same time.When would you
 create a user and delete them at the exact same time? Either the user exists or doesn't. Whatever state you end up in is probably sane, and odds are you won't do multiple actions as each depend on the opposite state.So, we need not to worry about the concurrent usage of vpop commands.Is my understanding correct?A big question is what harm can you cause? Concurrency can always lead to unpredictability, unless you lock the whole process. Even then, you could issue a command that negates the command before it (as a whole). Worst case updating a password for an e-mail address fails because the e-mail address is deleted... so it probably doesn't matter what the password is. Worst case you are updating a domain and it gets deleted, so again, who cares about the update- and occurring in the other order is
 fine too.Vpopmail will prevent corruption of your data, by using locking if needed (or depend on locking of a DB system). It will lock .qmail files when it writes them. Everything else shouldn't really matter. Maildir if it doesn't exist will be created, but you shouldn't get to that state.In a database, concurrency has issues. The textbook example is subtracting from an account balance, where if two programs update the balance at the same time (through two transactions), then they can cause problems (currbal=100, currbal-50, currbal-10 -=- possible outcomes are 90, 50, or 40). In this case, multiple updates to the same datum are uncommon, and any irregularity is still something the user wanted.-M

[vchkpw] concurrency

2006-07-05 Thread jhq
Hello,

Can we run the commands in:
   /home/vpopmail/bin
concurrently?
For instance, can someone run
  vadduser [EMAIL PROTECTED] password_foo
at the time when someone else run:
  vadduser [EMAIL PROTECTED] password_bar
?

Jun


Re: [vchkpw] concurrency

2006-07-05 Thread Jeremy Kitchen
On Wednesday 05 July 2006 11:39, [EMAIL PROTECTED] wrote:
 Hello,

 Can we run the commands in:
/home/vpopmail/bin
 concurrently?
 For instance, can someone run
   vadduser [EMAIL PROTECTED] password_foo
 at the time when someone else run:
   vadduser [EMAIL PROTECTED] password_bar
 ?

depends on what they do.

If they will modify the same files, you shouldn't.  Otherwise, sure.

For example.you can run vadddomain and vadduser (with a different domain) at 
the same time, but you shouldn't run two vaddusers on the same domain at the 
same time, etc.  There's locking involved that prevents them from stepping on 
each other, but I don't know if they will just see the file as locked and 
bomb out, or wait for the lock to clear, etc.

-Jeremy
-- 
Jeremy Kitchen ++ [EMAIL PROTECTED]

http://www.pirate-party.us/ -- defend your rights


pgp86qJWzBQXc.pgp
Description: PGP signature


Re: [vchkpw] concurrency

2006-07-05 Thread jhq
Hello Jeremy,

 Can we run the commands in: /home/vpopmail/bin concurrently? For
 instance, can someone run vadduser [EMAIL PROTECTED] password_foo at
 the time when someone else run: vadduser [EMAIL PROTECTED]
 password_bar ?
 
 
 depends on what they do.
 
 If they will modify the same files, you shouldn't.  Otherwise, sure.
 
 For example.you can run vadddomain and vadduser (with a different
 domain) at the same time, but you shouldn't run two vaddusers on the
 same domain at the same time, etc.  There's locking involved that
 prevents them from stepping on each other, but I don't know if they
 will just see the file as locked and bomb out, or wait for the lock
 to clear, etc.

Thank you for your help.

Jun



Re: [vchkpw] concurrency

2006-07-05 Thread Michael Krieger
In theory, ther'es always potential, particularly when dealing with files on disk. One program could in theory do one thing and not another.The MySQL database should deal with its own concurrency. The CDB database has .vpasswd.lock files when updating the password files.You probably don't have to worry about corrupting anything, but in theory one could get system time and do something unexpected on the other, particularly in deleting and creating folders. That's usually not that important. Odds are that's never going to happen that you do two opposite actions on the same [EMAIL PROTECTED] at the same time.Odds are, you won't cause any harm.-MJeremy Kitchen [EMAIL PROTECTED] wrote: On Wednesday 05 July 2006 11:39, [EMAIL PROTECTED] wrote: Hello, Can
 we run the commands in:/home/vpopmail/bin concurrently? For instance, can someone run   vadduser [EMAIL PROTECTED] password_foo at the time when someone else run:   vadduser [EMAIL PROTECTED] password_bar ?depends on what they do.If they will modify the same files, you shouldn't.  Otherwise, sure.For example.you can run vadddomain and vadduser (with a different domain) at the same time, but you shouldn't run two vaddusers on the same domain at the same time, etc.  There's locking involved that prevents them from stepping on each other, but I don't know if they will just see the file as locked and bomb out, or wait for the lock to clear, etc.-Jeremy-- Jeremy Kitchen ++ [EMAIL PROTECTED]http://www.pirate-party.us/ -- defend your rights