You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by dblotsky <gi...@git.apache.org> on 2015/04/07 01:48:13 UTC

[GitHub] cordova-medic pull request: [CB-8803] Reduce the effect of intermi...

GitHub user dblotsky opened a pull request:

    https://github.com/apache/cordova-medic/pull/40

    [CB-8803] Reduce the effect of intermittent workspace cleanup failure

    Really simple workaround for now. In the future a more complex wrapper should be made to persistently delete until the directory is gone, or emit a hard failure.

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

    $ git pull https://github.com/MSOpenTech/cordova-medic cb-8803

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

    https://github.com/apache/cordova-medic/pull/40.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 #40
    
----
commit eeaca538131f638d6bf0cdc1a93ff83728a37a16
Author: Dmitry Blotsky <db...@microsoft.com>
Date:   2015-04-06T23:02:57Z

    [CB-8803] Naive temporary workaround for issue.

----


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-medic pull request: [CB-8803] Reduce the effect of intermi...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/cordova-medic/pull/40


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-medic pull request: [CB-8803] Reduce the effect of intermi...

Posted by dmitriy-barkalov <gi...@git.apache.org>.
Github user dmitriy-barkalov commented on a diff in the pull request:

    https://github.com/apache/cordova-medic/pull/40#discussion_r27984199
  
    --- Diff: buildbot-conf/cordova.conf ---
    @@ -229,6 +229,8 @@ plugins_cleanup_steps = [
         NPMInstall(command=['shelljs'], what='shelljs'),
         RMRF('~/.cordova/*', description='removing cache', haltOnFailure=False),
         RMRF(BASE_WORKDIR + '/*', description='cleaning workspace', haltOnFailure=False),
    +    RMRF(BASE_WORKDIR + '/*', description='cleaning workspace again', haltOnFailure=False),
    +    RMRF(BASE_WORKDIR + '/*', description='cleaning workspace yet again', haltOnFailure=True),
    --- End diff --
    
    Here we have good deletion of workspace folder only but `~/.cordova/*` also could have the same issues. Also 2 extra steps in builder will confuse a user.
    
    I propose to move this workaround into `RMRF` function. This way there would be a clean deletion of any folder. I've made a quick test of deletion js script. I hope it will help to illustrate my idea:
    ```
    def RMRF(path, description=None, **kwargs):
    
        if description is None:
            description = 'removing ' + path
    
        # this is better than 'rm -rf' because it removes excessively long paths on Windows
        js_script = "var s = require('shelljs'); fs = require('fs'); path = require('path'); var attempts = 1, dir = path.dirname(path.normalize('{path}')); while((fs.readdirSync(dir).length > 0) && (attempts <= 10)) {{ console.log('removing {path} attempt ' + attempts); s.rm('-rf', '{path}'); attempts++; }} process.once('exit', function () {{ if (fs.readdirSync(dir).length > 0) {{ process.exit(1); }} }});".format(path=path)
    
        return SH(command=['node', '-e', js_script], description=description, **kwargs)
    ```


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-medic pull request: [CB-8803] Reduce the effect of intermi...

Posted by dblotsky <gi...@git.apache.org>.
Github user dblotsky commented on a diff in the pull request:

    https://github.com/apache/cordova-medic/pull/40#discussion_r28109060
  
    --- Diff: buildbot-conf/cordova.conf ---
    @@ -229,6 +229,8 @@ plugins_cleanup_steps = [
         NPMInstall(command=['shelljs'], what='shelljs'),
         RMRF('~/.cordova/*', description='removing cache', haltOnFailure=False),
         RMRF(BASE_WORKDIR + '/*', description='cleaning workspace', haltOnFailure=False),
    +    RMRF(BASE_WORKDIR + '/*', description='cleaning workspace again', haltOnFailure=False),
    +    RMRF(BASE_WORKDIR + '/*', description='cleaning workspace yet again', haltOnFailure=True),
    --- End diff --
    
    The solid solution, and hence the "proper fix", is to offload this work to a custom cleanup script. We currently have a chicken-and-egg problem because we need to download the script before we clean up, and then clean it up using itself. In the near future we should consolidate the medic scripts into an executable called `medic` that is not part of the downloaded repositories, and we will be able to clean up by calling something like:
    
        medic clean
        medic update_config
        medic build windows
    
    This will move a lot of logic out of buildbot, and it will also make the automated build tools more usable outside of buildbot.
    
    For now, the three steps are a very simple effective fix for the intermittent problem.


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-medic pull request: [CB-8803] Reduce the effect of intermi...

Posted by dblotsky <gi...@git.apache.org>.
Github user dblotsky commented on the pull request:

    https://github.com/apache/cordova-medic/pull/40#issuecomment-92532415
  
    Ping.


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-medic pull request: [CB-8803] Reduce the effect of intermi...

Posted by dmitriy-barkalov <gi...@git.apache.org>.
Github user dmitriy-barkalov commented on a diff in the pull request:

    https://github.com/apache/cordova-medic/pull/40#discussion_r28043272
  
    --- Diff: buildbot-conf/cordova.conf ---
    @@ -229,6 +229,8 @@ plugins_cleanup_steps = [
         NPMInstall(command=['shelljs'], what='shelljs'),
         RMRF('~/.cordova/*', description='removing cache', haltOnFailure=False),
         RMRF(BASE_WORKDIR + '/*', description='cleaning workspace', haltOnFailure=False),
    +    RMRF(BASE_WORKDIR + '/*', description='cleaning workspace again', haltOnFailure=False),
    +    RMRF(BASE_WORKDIR + '/*', description='cleaning workspace yet again', haltOnFailure=True),
    --- End diff --
    
    I think user of Buildbot can't fix issue inside Windows filesystem. So it is unnecessary to show that "something that still needs to be fixed properly" to him.
    
    Though we haven't seen the issue for `~/.cordova/*` it could happen. I assume that the cause of the issue is Windows filesystem and so `~/.cordova/*` and workspace folder have equal probability to have this issue.
    
    Also other developer could use `RMRF` function for removing other folders. It would be good to provide a solid solution to remove folder.


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-medic pull request: [CB-8803] Reduce the effect of intermi...

Posted by dblotsky <gi...@git.apache.org>.
Github user dblotsky commented on a diff in the pull request:

    https://github.com/apache/cordova-medic/pull/40#discussion_r28001029
  
    --- Diff: buildbot-conf/cordova.conf ---
    @@ -229,6 +229,8 @@ plugins_cleanup_steps = [
         NPMInstall(command=['shelljs'], what='shelljs'),
         RMRF('~/.cordova/*', description='removing cache', haltOnFailure=False),
         RMRF(BASE_WORKDIR + '/*', description='cleaning workspace', haltOnFailure=False),
    +    RMRF(BASE_WORKDIR + '/*', description='cleaning workspace again', haltOnFailure=False),
    +    RMRF(BASE_WORKDIR + '/*', description='cleaning workspace yet again', haltOnFailure=True),
    --- End diff --
    
    Both are functionally equivalent. I think the three repeated steps are a bit more clear, since it's very easy to see that it's repeated, and they make it evident on the waterfall page that this is something that still needs to be fixed properly.
    
    Also, we haven't seen this issue for `~/.cordova/*`.


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org