Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inotify not updating watch list with added subdirectories when auto_add and recursive are set to true until restart #53290

Open
whytewolf opened this issue May 28, 2019 · 1 comment
Labels
Beacon Bug broken, incorrect, or confusing behavior Confirmed Salt engineer has confirmed bug/feature - often including a MCVE ZD The issue is related to a Zendesk customer support ticket.

Comments

@whytewolf
Copy link
Contributor

Description of Issue

While using the inotify beacon if you setup a directory to watch and have recursive and auto_add set to true. If you add a subdirectory into the directory being watched new items will not be fully watched. You will get IN_MODIFY noticed for items in the subdirectories but until a restart, you can not get IN_CLOSE_WRITE items or other items of that nature.

once restarted inotify will include the subdirectories in the watched items list so will get the full feature of masks.

This can be further validated by adding a log line just like the following that lists out the watched items

    # Get paths currently being watched
    current = set()
    for wd in wm.watches:
        current.add(wm.watches[wd].path)
        log.debug('current watches: %s',wm.watches[wd].path)

Setup

beacons:
  status:
    - interval: 600
  inotify:
    - files:
        /tmp:
          recurse: True
          mask:
            - close_write
          auto_add: True

restart the minion then add a directory and copy a file into the directory you just created. If inotify had added the subdirectory you made you should see a new event on the bus. but you won't

If you add the logging item about you should see the new subdirectory in the event log if you have debug on. but that also doesn't happen.

After verifying that it works like describe restart the minion and see that all of the above works for that directory.

Steps to Reproduce Issue

restart the minion then add a directory and copy a file into the directory you just created. If inotify had added the subdirectory you made you should see a new event on the bus. but you won't

If you add the logging item about you should see the new subdirectory in the event log if you have debug on. but that also doesn't happen.

After verifying that it works like describe restart the minion and see that all of the above works for that directory.

The following is with the debug log described.

2019-05-28 16:02:17,432 [salt.utils.schedule:35  ][TRACE   ][15073] ==== evaluating schedule now None =====
2019-05-28 16:02:17,771 [salt.beacons     :35  ][TRACE   ][15073] Beacon processing: status
2019-05-28 16:02:17,772 [salt.beacons     :35  ][TRACE   ][15073] Processing interval 600 for beacon mod status
2019-05-28 16:02:17,772 [salt.beacons     :35  ][TRACE   ][15073] Processing interval in map
2019-05-28 16:02:17,772 [salt.beacons     :35  ][TRACE   ][15073] Interval counter: 109
2019-05-28 16:02:17,773 [salt.beacons     :35  ][TRACE   ][15073] Skipping beacon status. Interval not reached.
2019-05-28 16:02:17,773 [salt.beacons     :35  ][TRACE   ][15073] Beacon processing: inotify
2019-05-28 16:02:17,774 [salt.loaded.ext.beacons.inotify:275 ][DEBUG   ][15073] current watches: /tmp
2019-05-28 16:02:17,775 [salt.loaded.ext.beacons.inotify:275 ][DEBUG   ][15073] current watches: /tmp/.Test-unix
2019-05-28 16:02:17,775 [salt.loaded.ext.beacons.inotify:275 ][DEBUG   ][15073] current watches: /tmp/.ICE-unix
2019-05-28 16:02:17,775 [salt.loaded.ext.beacons.inotify:275 ][DEBUG   ][15073] current watches: /tmp/.font-unix
2019-05-28 16:02:17,776 [salt.loaded.ext.beacons.inotify:275 ][DEBUG   ][15073] current watches: /tmp/.X11-unix
2019-05-28 16:02:17,776 [salt.loaded.ext.beacons.inotify:275 ][DEBUG   ][15073] current watches: /tmp/.XIM-unix
2019-05-28 16:02:17,776 [salt.loaded.ext.beacons.inotify:275 ][DEBUG   ][15073] current watches: /tmp/openldap-tlsmc-certs--EE74860B999E17892613EA037DAA1B660EDB606E97B1E44773233ED36CCDB728
2019-05-28 16:02:17,776 [salt.loaded.ext.beacons.inotify:275 ][DEBUG   ][15073] current watches: /tmp/openldap-tlsmc-certs--EE74860B999E17892613EA037DAA1B660EDB606E97B1E44773233ED36CCDB728/cacerts
2019-05-28 16:02:17,777 [salt.loaded.ext.beacons.inotify:275 ][DEBUG   ][15073] current watches: /tmp/systemd-private-7eff4f142f7043ea8ec6b350b31e1089-chronyd.service-OCIMwl
2019-05-28 16:02:17,777 [salt.loaded.ext.beacons.inotify:275 ][DEBUG   ][15073] current watches: /tmp/systemd-private-7eff4f142f7043ea8ec6b350b31e1089-chronyd.service-OCIMwl/tmp
2019-05-28 16:02:17,777 [salt.loaded.ext.beacons.inotify:275 ][DEBUG   ][15073] current watches: /tmp/systemd-private-7eff4f142f7043ea8ec6b350b31e1089-named.service-dW6n5D
2019-05-28 16:02:17,777 [salt.loaded.ext.beacons.inotify:275 ][DEBUG   ][15073] current watches: /tmp/systemd-private-7eff4f142f7043ea8ec6b350b31e1089-named.service-dW6n5D/tmp
2019-05-28 16:02:17,778 [salt.utils.schedule:35  ][TRACE   ][15073] ==== evaluating schedule now None =====

after a restart the following

2019-05-28 16:06:54,560 [salt.utils.schedule:35  ][TRACE   ][16271] ==== evaluating schedule now None =====
2019-05-28 16:06:55,554 [salt.beacons     :35  ][TRACE   ][16271] Beacon processing: status
2019-05-28 16:06:55,554 [salt.beacons     :35  ][TRACE   ][16271] Processing interval 600 for beacon mod status
2019-05-28 16:06:55,555 [salt.beacons     :35  ][TRACE   ][16271] Processing interval in map
2019-05-28 16:06:55,555 [salt.beacons     :35  ][TRACE   ][16271] Interval counter: 4
2019-05-28 16:06:55,555 [salt.beacons     :35  ][TRACE   ][16271] Skipping beacon status. Interval not reached.
2019-05-28 16:06:55,555 [salt.beacons     :35  ][TRACE   ][16271] Beacon processing: inotify
2019-05-28 16:06:55,557 [salt.loaded.ext.beacons.inotify:275 ][DEBUG   ][16271] current watches: /tmp
2019-05-28 16:06:55,557 [salt.loaded.ext.beacons.inotify:275 ][DEBUG   ][16271] current watches: /tmp/.Test-unix
2019-05-28 16:06:55,557 [salt.loaded.ext.beacons.inotify:275 ][DEBUG   ][16271] current watches: /tmp/.ICE-unix
2019-05-28 16:06:55,558 [salt.loaded.ext.beacons.inotify:275 ][DEBUG   ][16271] current watches: /tmp/.font-unix
2019-05-28 16:06:55,558 [salt.loaded.ext.beacons.inotify:275 ][DEBUG   ][16271] current watches: /tmp/.X11-unix
2019-05-28 16:06:55,558 [salt.loaded.ext.beacons.inotify:275 ][DEBUG   ][16271] current watches: /tmp/.XIM-unix
2019-05-28 16:06:55,558 [salt.loaded.ext.beacons.inotify:275 ][DEBUG   ][16271] current watches: /tmp/openldap-tlsmc-certs--EE74860B999E17892613EA037DAA1B660EDB606E97B1E44773233ED36CCDB728
2019-05-28 16:06:55,558 [salt.loaded.ext.beacons.inotify:275 ][DEBUG   ][16271] current watches: /tmp/openldap-tlsmc-certs--EE74860B999E17892613EA037DAA1B660EDB606E97B1E44773233ED36CCDB728/cacerts
2019-05-28 16:06:55,559 [salt.loaded.ext.beacons.inotify:275 ][DEBUG   ][16271] current watches: /tmp/systemd-private-7eff4f142f7043ea8ec6b350b31e1089-chronyd.service-OCIMwl
2019-05-28 16:06:55,559 [salt.loaded.ext.beacons.inotify:275 ][DEBUG   ][16271] current watches: /tmp/systemd-private-7eff4f142f7043ea8ec6b350b31e1089-chronyd.service-OCIMwl/tmp
2019-05-28 16:06:55,559 [salt.loaded.ext.beacons.inotify:275 ][DEBUG   ][16271] current watches: /tmp/systemd-private-7eff4f142f7043ea8ec6b350b31e1089-named.service-dW6n5D
2019-05-28 16:06:55,559 [salt.loaded.ext.beacons.inotify:275 ][DEBUG   ][16271] current watches: /tmp/systemd-private-7eff4f142f7043ea8ec6b350b31e1089-named.service-dW6n5D/tmp
2019-05-28 16:06:55,560 [salt.loaded.ext.beacons.inotify:275 ][DEBUG   ][16271] current watches: /tmp/verify

Versions Report

    Salt Version:
               Salt: 2018.3.4
     
    Dependency Versions:
               cffi: 1.6.0
           cherrypy: Not Installed
           dateutil: 2.6.0
          docker-py: Not Installed
              gitdb: Not Installed
          gitpython: Not Installed
              ioflo: Not Installed
             Jinja2: 2.7.2
            libgit2: Not Installed
            libnacl: Not Installed
           M2Crypto: Not Installed
               Mako: Not Installed
       msgpack-pure: Not Installed
     msgpack-python: 0.4.6
       mysql-python: Not Installed
          pycparser: 2.14
           pycrypto: 2.6.1
       pycryptodome: Not Installed
             pygit2: Not Installed
             Python: 2.7.14 (default, Jul 26 2018, 19:59:38)
       python-gnupg: Not Installed
             PyYAML: 3.10
              PyZMQ: 15.3.0
               RAET: Not Installed
              smmap: Not Installed
            timelib: Not Installed
            Tornado: 4.2.1
                ZMQ: 4.1.4
     
    System Versions:
               dist:   
             locale: ascii
            machine: x86_64
            release: 4.14.104-95.84.amzn2.x86_64
             system: Linux
            version: Not Installed

And

Salt Version:
           Salt: 2019.2.0

Dependency Versions:
           cffi: 1.11.5
       cherrypy: Not Installed
       dateutil: 1.5
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.7.2
        libgit2: Not Installed
        libnacl: 1.6.1
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.5.6
   mysql-python: Not Installed
      pycparser: 2.14
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.5 (default, Apr  9 2019, 14:30:50)
   python-gnupg: Not Installed
         PyYAML: 3.13
          PyZMQ: 15.3.0
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.1.4

System Versions:
           dist: centos 7.6.1810 Core
         locale: UTF-8
        machine: x86_64
        release: 3.10.0-957.12.1.el7.x86_64
         system: Linux
        version: CentOS Linux 7.6.1810 Core
@whytewolf whytewolf added the ZD The issue is related to a Zendesk customer support ticket. label May 28, 2019
@whytewolf
Copy link
Contributor Author

ZD-3761

@dmurphy18 dmurphy18 added Beacon Bug broken, incorrect, or confusing behavior Confirmed Salt engineer has confirmed bug/feature - often including a MCVE labels May 29, 2019
@dmurphy18 dmurphy18 added this to the Approved milestone May 29, 2019
@sagetherage sagetherage added the Phosphorus v3005.0 Release code name and version label May 18, 2021
@sagetherage sagetherage modified the milestones: Approved, Phosphorus May 18, 2021
@Ch3LL Ch3LL removed the Phosphorus v3005.0 Release code name and version label Mar 30, 2022
@anilsil anilsil removed this from the Chlorine v3007.0 milestone May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Beacon Bug broken, incorrect, or confusing behavior Confirmed Salt engineer has confirmed bug/feature - often including a MCVE ZD The issue is related to a Zendesk customer support ticket.
Projects
None yet
Development

No branches or pull requests

6 participants