brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From neykov <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: web app deploy - use temporary fi...
Date Mon, 30 Mar 2015 13:50:45 GMT
GitHub user neykov opened a pull request:

    https://github.com/apache/incubator-brooklyn/pull/579

    web app deploy - use temporary file for upload

    **WARN:** The fix changes the semantics of the deploy method. Previously it always succeeded
regardless of the result of the copy operation. Now it will fail if either the copy or the
rename operations fail.
    
    Uploading the file directly to the webapps folder results in autodeploy triggering before
the upload is complete. A problem arises when autodeploy triggers in the same second (before)
the upload completes - it will fail due to incomplete file, but will not retry because the
timestamp of the file won't change. Change deploy to upload to a temporary file and rename
it to a .war only when done. This has a few benefits:
      * The application won't be undeployed at the start of the upload and be down for the
duration of the upload
      * Once the server observers the updated file we can be sure that it read its full content
      * If the upload fails (timeout, connection reset, full disk...) the old app won't be
undeployed.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/neykov/incubator-brooklyn fix/war-deploy

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-brooklyn/pull/579.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #579
    
----
commit 14ff153a066b5155349a7ed30718f0dd9b8889a9
Author: Svetoslav Neykov <svetoslav.neykov@cloudsoftcorp.com>
Date:   2015-03-30T13:48:29Z

    web app deploy - use temporary file for upload
    
    Uploading the file directly to the webapps folder results in autodeploy triggering before
the upload is complete. A problem arises when autodeploy triggers in the same second (before)
the upload completes - it will fail due to incomplete file, but will not retry because the
timestamp of the file won't change. Change deploy to upload to a temporary file and rename
it to a .war only when done. This has a few benefits:
      * The application won't be undeployed at the start of the upload and be down for the
duration of the upload
      * Once the server observers the updated file we can be sure that it read its full content
      * If the upload fails (timeout, connection reset, full disk...) the old app won't be
undeployed.
    
    The fix changes the semantics of the deploy method. Previously it always succeeded regardless
of the result of the copy operation. Now it will fail if either the copy or the rename operations
fail.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message