Apache S4
  1. Apache S4
  2. S4-56

Prevent concurrent access to published s4r files


    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.5.0
    • Fix Version/s: 0.5.0
    • Labels:


      When using a file system-based deployment, and when a new application is deployed, multiple nodes receive a notification and try reading the same compressed archive concurrently. This may result in issues such as:

      ZkClient-EventThread-15-localhost:2181] INFO  org.apache.s4.core.Server - Local app deployment: using s4r file name [MY_APP] as application name
      java.util.zip.ZipException: error in opening zip file
      	at java.util.zip.ZipFile.open(Native Method)
      	at java.util.zip.ZipFile.<init>(ZipFile.java:127)
      	at java.util.zip.ZipFile.<init>(ZipFile.java:88)
      	at org.apache.s4.base.util.JarResources.init(JarResources.java:58)
      	at org.apache.s4.base.util.JarResources.<init>(JarResources.java:41)
      	at org.apache.s4.base.util.S4RLoader.<init>(S4RLoader.java:28)
      	at org.apache.s4.core.Server.loadApp(Server.java:122)
      	at org.apache.s4.core.Server.loadApp(Server.java:115)
      	at org.apache.s4.deploy.DistributedDeploymentManager.deployApplication(DistributedDeploymentManager.java:119)
      	at org.apache.s4.deploy.DistributedDeploymentManager.deployApps(DistributedDeploymentManager.java:164)
      	at org.apache.s4.deploy.DistributedDeploymentManager.deployNewApps(DistributedDeploymentManager.java:158)
      	at org.apache.s4.deploy.DistributedDeploymentManager.access$200(DistributedDeploymentManager.java:57)
      	at org.apache.s4.deploy.DistributedDeploymentManager$AppsChangeListener.handleChildChange(DistributedDeploymentManager.java:178)
      	at org.I0Itec.zkclient.ZkClient$7.run(ZkClient.java:568)
      	at org.I0Itec.zkclient.ZkEventThread.run(ZkEventThread.java:71) 

      As a consequence, the application cannot be deployed on the nodes that see this issue, unless these nodes are restarted.

      A solution might be to prevent concurrent access to the archive through a lock which could be an ephemeral node in ZooKeeper.

        Issue Links


          Matthieu Morel created issue -
          Matthieu Morel made changes -
          Field Original Value New Value
          Link This issue is superceded by S4-71 [ S4-71 ]
          Matthieu Morel made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Tony Stevenson made changes -
          Workflow jira [ 12672895 ] no-reopen-closed, patch-avail [ 12711372 ]


            • Assignee:
              Matthieu Morel
              Matthieu Morel
            • Votes:
              0 Vote for this issue
              1 Start watching this issue


              • Created: