Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Testing unexpected I/O failures

by jszinger (Scribe)
on Nov 24, 2020 at 17:49 UTC ( [id://11124150]=note: print w/replies, xml ) Need Help??


in reply to Testing unexpected I/O failures

Run two processes. The first changes the input file as fast as possible. The second one runs the test until an error occurs. If you get the right error, then the test passes; otherwise the test fails. Running more copies of the test at once should increase the chances of hitting the race condition. But why have the race condition at all? Opening the input file provides the needed feedback about the parameter. Are you sure you also don’t have a race condition the directory and output checks?

Replies are listed 'Best First'.
Re^2: Testing unexpected I/O failures
by kcott (Archbishop) on Nov 24, 2020 at 21:19 UTC

    G'day jszinger,

    I had considered something along the lines you suggest (with multiple processes) but decided it was too hit-and-miss for my liking. Looking at the situation where one process changes read permissions, it is more likely this will happen before -r fails or after open succeeds, than in the very tiny window between -r and open.

    Please see my response to ++Fletch's post regarding my reasons for wanting specific parameter checks and reporting. The solution he suggests is along the same lines as yours: at the moment, that's the most likely course of action that I'll follow.

    I'm doing file checks on both the directory and file parameters so, yes, race conditions are possible there.

    — Ken

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11124150]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2024-03-28 13:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found