Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 148440 Details for
Bug 228801
NFS race can create persistent stale negative dentries
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
Enhanced python script that reproduces the problem.
hit_nfs.py (text/x-python), 4.88 KB, created by
Fabio Olive Leite
on 2007-02-20 20:38:52 UTC
(
hide
)
Description:
Enhanced python script that reproduces the problem.
Filename:
MIME Type:
Creator:
Fabio Olive Leite
Created:
2007-02-20 20:38:52 UTC
Size:
4.88 KB
patch
obsolete
>#!/usr/bin/python > >import os >import posix >import threading >import time > ># BEGIN environment config >local_dir = "/local/foo" >nfs_dir = "/nfs/foo" ># END environment config > >stop_threads = 0 >pause_threads = 0 >server_paused = 0 > ># There is a bit of a race in using the globals above, but it's not really ># important, since they only help detect false positives. > >def rm_rf(): > "Simulate the recursive removal of the data files in the server side" > os.chdir(local_dir) > try: > os.unlink("bar") > except: > pass > # The first unlink should always fail > try: > os.chdir("bar") > os.chdir("baz") > for i in range(10): > os.unlink("file" + str(i)) > os.chdir("..") > os.rmdir("baz") > os.chdir(local_dir) > os.rmdir("bar") > except: > pass > # I don't think we should care > >def tar(): > "Simulate the untarring of the data files in the server side" > dirs = "bar/baz" > atime = int(time.time()) > mtime = 1167270383; > os.chdir(local_dir) > os.makedirs(dirs, 0755) > for i in range(10): > name = dirs + "/file" + str(i) > fd = posix.open(name, posix.O_WRONLY | posix.O_CREAT | posix.O_EXCL | posix.O_LARGEFILE, 0644) > posix.write(fd, str(i)) > posix.close(fd) > #posix.utime(name, (atime, mtime)) > #posix.utime(dirs, (atime, 1170209482)) > #posix.utime("bar", (atime, 1170134717)) > >def server_side(): > "Alternate removing and restoring the files on the server" > global stop_threads > global pause_threads > global server_paused > while not stop_threads: > print "Server-side thread working" > f = os.fork() > if f == 0: > rm_rf() > os._exit(0) > else: > os.waitpid(f, 0) > f = os.fork() > if f == 0: > tar() > os._exit(0) > else: > os.waitpid(f, 0) > if pause_threads: > server_paused = 1 > while pause_threads: > time.sleep(1) > server_paused = 0 > else: > time.sleep(5) > print "Server-side thread exiting by request" > ># Yes there is a pattern in the three functions below ># No time to re-write now :) > >def stat_dir(): > "stat the data directory every two seconds" > global stop_threads > global pause_threads > global server_paused > error_once = 0 > #print "stat_dir thread started" > while not stop_threads: > try: > os.stat(nfs_dir + "/bar") > except: > print "Error while stating directory!" > error_once = 1 > if error_once: > if pause_threads: > while pause_threads: > time.sleep(1) > else: > pause_threads = 1 > while not server_paused: > time.sleep(1) > try: > os.stat(nfs_dir + "/bar") > print "Error recovered, continuing..." > error_once = 0 > except: > print "Error while stating directory confirmed!" > stop_threads = 1 > pause_threads = 0 > else: > time.sleep(2) > #print "stat_dir thread exiting by request" > >def stat_file(): > "stat a file in the data directory every two seconds" > global stop_threads > global pause_threads > global server_paused > error_once = 0 > #print "stat_file thread started" > while not stop_threads: > try: > os.stat(nfs_dir + "/bar/baz/file9") > except: > print "Error while stating file!" > error_once = 1 > if error_once: > if pause_threads: > while pause_threads: > time.sleep(1) > else: > pause_threads = 1 > while not server_paused: > time.sleep(1) > try: > os.stat(nfs_dir + "/bar/baz/file9") > print "Error recovered, continuing..." > error_once = 0 > except: > print "Error while stating file confirmed!" > stop_threads = 1 > pause_threads = 0 > else: > time.sleep(2) > #print "stat_file thread exiting by request" > >def open_dir(): > "open the data directory every two seconds" > global stop_threads > global pause_threads > global server_paused > error_once = 0 > #print "open_dir thread started" > while not stop_threads: > try: > fd = posix.open(nfs_dir + "/bar", posix.O_RDONLY | posix.O_DIRECTORY) > posix.close(fd) > except: > print "Error while opening directory!" > error_once = 1 > if error_once: > if pause_threads: > while pause_threads: > time.sleep(1) > else: > pause_threads = 1 > while not server_paused: > time.sleep(1) > try: > fd = posix.open(nfs_dir + "/bar", posix.O_RDONLY | posix.O_DIRECTORY) > posix.close(fd) > print "Error recovered, continuing..." > error_once = 0 > except: > print "Error while opening directory confirmed!" > stop_threads = 1 > pause_threads = 0 > else: > time.sleep(2) > #print "open_dir thread exiting by request" > ># Start up server thread >server = threading.Thread(target = server_side) >server.start() >time.sleep(1) > ># Start up all client threads >client_threads = [] >for i in range(100): > t = threading.Thread(target = stat_dir) > t.start() > client_threads.append(t) >for i in range(100): > t = threading.Thread(target = stat_file) > t.start() > client_threads.append(t) >for i in range(100): > t = threading.Thread(target = open_dir) > t.start() > client_threads.append(t) >print "All client threads started" > ># Limit run time for debugging purposes >#time.sleep(30) >#stop_threads = 1 > ># Join threads and wait for termination >server.join() >for t in client_threads: > t.join() > >print "All threads stopped, terminating"
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 228801
:
148096
|
148097
| 148440 |
150805
|
157492
|
158367