Red Hat Bugzilla – Bug 1299070
Apply-updates.bat issue "requested operation cannot be performed on a file with a user-mapped section open)"
Last modified: 2016-02-18 08:41:17 EST
Description of problem:
When running apply-updates.bat to patch the JON server, you can get "requested operation cannot be performed on a file with a user-mapped section open)" errors during patch application.
Version-Release number of selected component (if applicable):
Most of the time.
Steps to Reproduce:
1. Using 3.3.5 DR01 patch on windows, attempt to apply-update.bat on a JON server.
2. Monitor the patch log files to look for following exception
>jon-server-3.3.0.GA-update-05\apply-updates.bat jon-server-3.3.0.GA > apply-updated_1-15-16_2324.txt
java.io.FileNotFoundException: c:\temp\3n\jon-server-3.3.0.GA\bin\rhq-server.properties (The requested operation cannot
be performed on a file with a user-mapped section open)
at java.io.FileOutputStream.open(Native Method)
No exceptions during patch application and correct fixes applied to servers with invalid SSL settings.
See [BZ 1277389] for more details on invalid ssl settings.
This is fixed with commit: e827551d480a179b3a2 to jon.git. Moving to MODIFIED.
The issue here was that the newest logic to fix https://bugzilla.redhat.com/show_bug.cgi?id=1277389 re-used an existing RHQ library to optionally modify properties. Even though the correct java file i/o operations were used to clean up the file handles, the windows operating system locks were sometimes taking a while to be cleaned up/garbage collected, triggering the "user-mapped section open" issues.
There are several BZ's filed for this type of issue against the Sun/Oracle JDK for earlier 1.6 and earlier. Many were closed with no intention to fix because the problem was the underlying operating system file locking. See here as one example: http://bugs.java.com/view_bug.do?bug_id=4715154
The fix was to refactor the logic to instead handle all of the file I/O and be more careful about not triggering the windows file locking but still cleaning up the resources as is necessary. The new approach only uses BufferedReader/Writers and delays the use of the close() calls.
Moving to ON_QA for testing with the following build:
*Note: jon-server-patch-3.3.0.GA.zip maps to ER01 build of
3.3.0.GA Update 05
Build Number :