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

FS trigger looking at way way way way way too much on a job configuration change (or jenkins startup)

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • fstrigger-plugin
    • None
    • rhel 5.5

      I changed the job config to exclude a sub-tree from fs triggers search while a strace -f 2>&1 | grep open was running on the jenkins process

      I saw that it was
      1. calling open|DIR on every file in the tree,
      2. calling open|DIR even on files I had told it not to look at.

      e.g.

      FS trigger checked
      path "/view/foo/vobs/bar"
      include "*/.c */.h"
      excludes "understand/** */obj/*"

      every time I save the configuration it attempts the open on the bizillion supposedly excluded files
      in understand/udb_html/* and those in /obj/.o when it should not have looked at a single file in those sub-trees.
      as well as hundreds of non-included files (*/.project, etc)

      I think that whatever fileset like thing is under the hood of fstrigger is mis-used or poorly implemented

      It should
      1. not look for sub-dirs in excluded patterns
      2. not assume everything is a dir to be searched inside of

      Its almost as if its applying the include filter first, then reducing the results after the fact instead of applying the exclude filter as it considers each filesystem entry in the path.

          [JENKINS-11569] FS trigger looking at way way way way way too much on a job configuration change (or jenkins startup)

          I don't understand the problem.
          Could you attach your configuration file and try how to resolve it?

          Gregory Boissinot added a comment - I don't understand the problem. Could you attach your configuration file and try how to resolve it?

          the only parts of the config file that should be relevant are shown

          note that while this is a CC dynamic view, Jenkins isn't starting the view as part of the job. so it should be just as any file path based workspace

          <triggers class="vector">
          <org.jenkinsci.plugins.fstrigger.triggers.FolderContentTrigger>
          <spec>1 * * * *</spec>
          <path>/view/FOO/vobs/BAR</path>
          <includes>*/.c */.h</includes>
          <excludes>understand/**</excludes>
          </org.jenkinsci.plugins.fstrigger.triggers.FolderContentTrigger>
          </triggers>

          <customWorkspace>/view/FOO/vobs</customWorkspace>

          Greg Moncreaff added a comment - the only parts of the config file that should be relevant are shown note that while this is a CC dynamic view, Jenkins isn't starting the view as part of the job. so it should be just as any file path based workspace <triggers class="vector"> <org.jenkinsci.plugins.fstrigger.triggers.FolderContentTrigger> <spec>1 * * * *</spec> <path>/view/FOO/vobs/BAR</path> <includes>* / .c * / .h</includes> <excludes>understand/**</excludes> </org.jenkinsci.plugins.fstrigger.triggers.FolderContentTrigger> </triggers> <customWorkspace>/view/FOO/vobs</customWorkspace>

          If I add the possibility to not schedule a check when you save your job, are you OK?
          Does it meet your request?

          Gregory Boissinot added a comment - If I add the possibility to not schedule a check when you save your job, are you OK? Does it meet your request?

          Seeing that the plugin's use of the fileset on job save looks at excluded dirs is the symptom, not the cause.

          After drilling into the Hudson.Util code for fileset I think the cause it mostly a misuse (and mis-understanding). on my part, of use use of FileSet, due to lack of examples in doc in this plug-in.

          Correct me if I'm again, wrong, but

          • fileset patterns are comma, separated (put in '?' help please!) (e.g. */.c, */.h)
          • you only want to use excludes to subtract away something from includes
            e.g. include: */.c, exclude */stubs/.c and don't need to use it otherwise
            e.g. (put in help please!)
            if you have /foo/bar/.../.c and foo/narf/.../.c and only want the first sub-tree
            if you path: /foo and include bar/*/.c, you don't need to exclude /foo/narf (with an exclude of narf/*/.c)
            if you path: /foo/bar and include */.c, you don't need to exclude anything
            if you path: /foo and include */.c, you need to exclude narf/*/.c

          a pointer to the sans explanation of ant fileset is of no help to a new user,
          as that link has zero usage examples that compare tree with goals of the set

          Greg Moncreaff added a comment - Seeing that the plugin's use of the fileset on job save looks at excluded dirs is the symptom, not the cause. After drilling into the Hudson.Util code for fileset I think the cause it mostly a misuse (and mis-understanding). on my part, of use use of FileSet, due to lack of examples in doc in this plug-in. Correct me if I'm again, wrong, but fileset patterns are comma, separated (put in '?' help please!) (e.g. * / .c, * / .h) you only want to use excludes to subtract away something from includes e.g. include: * / .c, exclude * /stubs/ .c and don't need to use it otherwise e.g. (put in help please!) if you have /foo/bar/.../ .c and foo/narf/.../ .c and only want the first sub-tree if you path: /foo and include bar/* / .c, you don't need to exclude /foo/narf (with an exclude of narf/* / .c) if you path: /foo/bar and include * / .c, you don't need to exclude anything if you path: /foo and include * / .c, you need to exclude narf/* / .c a pointer to the sans explanation of ant fileset is of no help to a new user, as that link has zero usage examples that compare tree with goals of the set

          Can I set the issue to 'Fixed'?

          Gregory Boissinot added a comment - Can I set the issue to 'Fixed'?

          I'd still recommend updating the help for one or of the path/includes/excludes to have better examples.

          Greg Moncreaff added a comment - I'd still recommend updating the help for one or of the path/includes/excludes to have better examples.

          Code changed in jenkins
          User: Gregory Boissinot
          Path:
          src/main/resources/org/jenkinsci/plugins/fstrigger/triggers/FolderContentTrigger/config.properties
          http://jenkins-ci.org/commit/fstrigger-plugin/70a45ed6caba72c4a1faf05c89e5cb39b40444dc
          Log:
          Fixed JENKINS-11569

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gregory Boissinot Path: src/main/resources/org/jenkinsci/plugins/fstrigger/triggers/FolderContentTrigger/config.properties http://jenkins-ci.org/commit/fstrigger-plugin/70a45ed6caba72c4a1faf05c89e5cb39b40444dc Log: Fixed JENKINS-11569

          Could you check the fix?
          Thanks

          Gregory Boissinot added a comment - Could you check the fix? Thanks

          The fix is included in FSTrigger 0.17

          Gregory Boissinot added a comment - The fix is included in FSTrigger 0.17

            gbois Gregory Boissinot
            moncreaff Greg Moncreaff
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: