Forum archive 2000-2006

John Jones - File locking?

John Jones - File locking?

by Arnold Pizer -
Number of replies: 0
inactiveTopicFile locking? topic started 9/7/2003; 1:00:16 PM
last post 9/7/2003; 2:03:00 PM
userJohn Jones - File locking?  blueArrow
9/7/2003; 1:00:16 PM (reads: 715, responses: 1)
Up until now, we have used the access log to check when students say they have done things in WW but their answers have not been recorded.  When WW appends to the access log, it does not seem to lock it for writing.  So, if there are many accesses happening, is it possible that some of the log entries are lost?

A greater concern would be if this sort of thing could happen when writing to the database.  I have had quite a few reports of people claiming that they did various things (students submitting answers, teachers adding students), but the results were not recorded. Is that possible?

John

<| Post or View Comments |>


userMichael Gage - Re: File locking?  blueArrow
9/7/2003; 2:03:00 PM (reads: 919, responses: 0)
Writing to the log files without locking seems to be standard practice with CGI scripts. I do not know of a case where this has caused trouble in 6+ years of use. I think the append
task is so fast that it must be fairly safe and atomic.  Otherwise you would see garbled lines in log files where one message is inserted in the middle of another.  I've never seen that myself.

Accessing the database is another story.  This process takes longer and WeBWorK manually locks the database when ever something is written into the database.  If a write is taking place other processes need to loop and wait for the database to be free before they can either read or write to the database.  This process is the one used for GDBM databases and other low level databases.  WeBWorK2 takes advanatage of the higher level commands of mySQL which take care of the locking problem within the database itself when it is run with the mySQL.  When using GDBM and WeBWorK2, the manual locking is supposed to take place, although that aspect has not been tested as long or as hard as it has been in WeBWorK 1.8.

--Mike

<| Post or View Comments |>