Bug 249387
| Summary: | 'I/O operation on closed file' in rhn.transports.File instance | ||
|---|---|---|---|
| Product: | Red Hat Satellite 5 | Reporter: | Jan Pazdziora (Red Hat) <jpazdziora> |
| Component: | API | Assignee: | Jan Pazdziora (Red Hat) <jpazdziora> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Corey Welton <cwelton> |
| Severity: | low | Docs Contact: | |
| Priority: | low | ||
| Version: | 500 | CC: | cperry, rhn-bugs |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | sat501 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2007-08-29 15:30:11 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Jan Pazdziora (Red Hat)
2007-07-24 09:08:38 UTC
Here's the result of the investigation:
The Repository.repodata method in /usr/share/rhn/server/rhnRepository.py calls
output = rpclib.File(output, name=file_name)
The rpclib.File is the same as transports.File, and the output parameter passed
to the File constructor is of the type common.rhnCache.ReadLockedFile. The
transports.File objects is then processed through apacheRequest's response and
response_file, and response_file calls
response.close()
And since the transports.File's constructor did
self.close = file_obj.close
the ReadLockedFile's close is directly called.
And the close is called again in transports.File's desctructor.
We can handle the problem at the rhnCache's level, by allowing multiple calls to
the close method:
Index: rhnCache.py
===================================================================
--- rhnCache.py (revision 118530)
+++ rhnCache.py (working copy)
@@ -160,11 +160,12 @@
self.closed = False
def close(self):
- self.close_fd()
+ if not self.closed:
+ self.close_fd()
- _unlock(self.fd.fileno())
- self.fd.close()
- self.closed = True
+ _unlock(self.fd.fileno())
+ self.fd.close()
+ self.closed = True
# def __del__(self):
# if not self.closed:
Another possibility is to get rid of the
self.close = file_obj.close
in transports.File, make close a proper method there, and set the flag that the
close was called in transports.File.
Fix committed to SVN, branch RELEASE-5.0, revision 118566, and trunk, revision 118567. Moving ON_QA because: Satellite 5.0.1-1 and Proxy 5.0.1-1 are now available on webqa hosted channels. Satellite 5.0.1-1 ISOs are now available. QA Verified - running 'yum check-update' on a RHEL5 system against a 501 satellite results in no errors appearing in /var/log/httpd/error_log RELEASE_PENDING Removed Bug 249387 blocks bug 437059. |