Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-5314

Patch for bug 5313

XMLWordPrintable

    • Icon: Patch Patch
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • core
    • None
    • Windows

      I can not find a way to attach a patch to bug 5313, so here it is.

       
      Index: main/remoting/src/main/java/hudson/remoting/RemoteClassLoader.java
      ===================================================================
      --- main/remoting/src/main/java/hudson/remoting/RemoteClassLoader.java	(revision 26080)
      +++ main/remoting/src/main/java/hudson/remoting/RemoteClassLoader.java	(working copy)
      @@ -258,7 +258,20 @@
       
       
           private File makeResource(String name, byte[] image) throws IOException {
      -        File tmpFile = File.createTempFile("hudson-remoting", "");
      +    	//work around sun bug 6325169 on windows
      +    	//see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6325169
      +        File tmpFile = null;
      +        IOException lastException = null;
      +        for(int i=0; i<100 && tmpFile==null; i++) {
      +        	try {
      +        		tmpFile = File.createTempFile("hudson-remoting", "");
      +        	}catch(IOException e) {
      +        		lastException = e;
      +        	}
      +        }
      +        if(tmpFile == null) {
      +        	throw new IOException("Failed hard at creating a temp directory", lastException);
      +        }
               tmpFile.delete();
               File resource = new File(tmpFile, name);
               resource.getParentFile().mkdirs();
      

            Unassigned Unassigned
            jnegre jnegre
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: