updatecenter2
  1. updatecenter2
  2. UPDATECENTER2-1928

notifier scheduler does not exit if image list becomes empty

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: B42
    • Fix Version/s: B38
    • Component/s: notifier
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      1,928
    • Tags:

      Description

      The notifier scheduler should exit if the image list becomes empty. It
      currently does not due to a failure to reset a variable.

        Activity

        Hide
        Chris Kasso added a comment -

        Here's what I think is going on:

        1) Notifier scheduler is started when the user log's in. It runs the notifier.
        2) All the images are closed (but the notifier.cfg still points to a valid image).
        3) The next time the notifier scheduler wakes up which could take up to six
        hours it sees that a valid image still exists (pointed to by the notifier.cfg)
        and starts the notifier.
        4) The started notifier sees that the imagelist is empty so it returns exit code 99.
        5) The notifier scheduler, upon seeing exit code 99 will exit at that point.

        Note that when you log out the notifier scheduler may not exit immediately.
        Since it does not have a GUI attached to it it does not no the user logged out
        of the system. It may still take up to six hours before the notifier scheduler
        notices that the imagelist is empty. At that point it will exit.

        To help test this situation you can modify the notifier.sh script in
        ~/.updatetool/notifier.sh. Change debug=0 to debug=1 and restart the
        scheduler. This will cause the scheduler to wake up every 60 seconds instead
        of every 6 hours.

        Show
        Chris Kasso added a comment - Here's what I think is going on: 1) Notifier scheduler is started when the user log's in. It runs the notifier. 2) All the images are closed (but the notifier.cfg still points to a valid image). 3) The next time the notifier scheduler wakes up which could take up to six hours it sees that a valid image still exists (pointed to by the notifier.cfg) and starts the notifier. 4) The started notifier sees that the imagelist is empty so it returns exit code 99. 5) The notifier scheduler, upon seeing exit code 99 will exit at that point. Note that when you log out the notifier scheduler may not exit immediately. Since it does not have a GUI attached to it it does not no the user logged out of the system. It may still take up to six hours before the notifier scheduler notices that the imagelist is empty. At that point it will exit. To help test this situation you can modify the notifier.sh script in ~/.updatetool/notifier.sh. Change debug=0 to debug=1 and restart the scheduler. This will cause the scheduler to wake up every 60 seconds instead of every 6 hours.
        Hide
        faouzia added a comment -

        I tried the following with 2.3U2 toolkit on MAC-OS:

        • I created a user image with updatetool and installed an older version of MQ to this user image
        • I set the debug to 1 in ~/Library/Application Support/updatetool/notifier
        • I logout/login
        • The notifier reported there are updates
        • I launched updatetool and closed all the user images
        • I logout/login

        I checked the notifier scheduler immediately after login and 2 hours after and this process is still there :
        alandaluz:~ admin$ ps -ef | grep notifier

        Just after logout/login :
        ==========
        501 85228 80557 0 0:00.01 ?? 0:00.02 /bin/sh /Users/admin/Library/Application
        Support/updatetool/notifier
        501 85381 85305 0 0:00.00 ttys001 0:00.00 grep notifier

        2 hours after logout/login :
        =================
        alandaluz:~ admin$ ps -ef | grep notifier

        501 85228 80557 0 0:00.41 ?? 0:00.60 /bin/sh /Users/admin/Library/Application
        Support/updatetool/notifier
        501 90916 85228 0 0:00.01 ?? 0:00.01 /bin/sh –
        /Users/admin/UC23U2/UpgradeTests/Test7/pkg-toolkit-darwin-universal/updatetool/bin/updatetool
        --notifier --timerdebug --silentstart --check-and-exit
        501 90959 85305 0 0:00.00 ttys001 0:00.00 grep notifier
        alandaluz:~ admin$

        Default.cfg main :

        [main]
        preferences.version = 0.1
        ad.feed.url =
        image_list =
        maximum_recent_items = 3
        _last_active_image =
        featured.feed.url = http://pkg.sun.com/layered/feeds/featured.xml
        optin.update.notification = true

        alandaluz:~ admin$ more ~/Library/Application\ Support/updatetool/notifier.cfg
        /Users/admin/UC23U2/UpgradeTests/Test7/pkg-toolkit-darwin-universal
        alandaluz:~ admin$

        So even with debug=1, the notifier scheduler does not exit.

        I will check what happens after 6 hours

        Show
        faouzia added a comment - I tried the following with 2.3U2 toolkit on MAC-OS: I created a user image with updatetool and installed an older version of MQ to this user image I set the debug to 1 in ~/Library/Application Support/updatetool/notifier I logout/login The notifier reported there are updates I launched updatetool and closed all the user images I logout/login I checked the notifier scheduler immediately after login and 2 hours after and this process is still there : alandaluz:~ admin$ ps -ef | grep notifier Just after logout/login : ========== 501 85228 80557 0 0:00.01 ?? 0:00.02 /bin/sh /Users/admin/Library/Application Support/updatetool/notifier 501 85381 85305 0 0:00.00 ttys001 0:00.00 grep notifier 2 hours after logout/login : ================= alandaluz:~ admin$ ps -ef | grep notifier 501 85228 80557 0 0:00.41 ?? 0:00.60 /bin/sh /Users/admin/Library/Application Support/updatetool/notifier 501 90916 85228 0 0:00.01 ?? 0:00.01 /bin/sh – /Users/admin/UC23U2/UpgradeTests/Test7/pkg-toolkit-darwin-universal/updatetool/bin/updatetool --notifier --timerdebug --silentstart --check-and-exit 501 90959 85305 0 0:00.00 ttys001 0:00.00 grep notifier alandaluz:~ admin$ Default.cfg main : [main] preferences.version = 0.1 ad.feed.url = image_list = maximum_recent_items = 3 _last_active_image = featured.feed.url = http://pkg.sun.com/layered/feeds/featured.xml optin.update.notification = true alandaluz:~ admin$ more ~/Library/Application\ Support/updatetool/notifier.cfg /Users/admin/UC23U2/UpgradeTests/Test7/pkg-toolkit-darwin-universal alandaluz:~ admin$ So even with debug=1, the notifier scheduler does not exit. I will check what happens after 6 hours
        Hide
        faouzia added a comment -

        I checked this morning on the machine, and the notifier scheduler process was
        still running.

        Show
        faouzia added a comment - I checked this morning on the machine, and the notifier scheduler process was still running.
        Hide
        Chris Kasso added a comment -

        There appeared to be two problems:

        There was a case where the notifier code would return 0 instead of 99 when the
        image list was empty.

        On OS X the exit code from the python process was not propagating to the
        updatetool.sh script. On OS X when updatetool is invoked it uses open to invoke
        the UpdateToolNotifier.app which in turn execs updatetool.sh with the --macapp
        option which invokes python. The open method does not return the exit code
        from the process in which it invoked.


        Sending
        2.3sustaining/scripts/mac/SoftwareUpdate.app/Contents/MacOS/Updatetool
        Sending 2.3sustaining/scripts/mac/UpdateTool.app/Contents/MacOS/Updatetool
        Sending
        2.3sustaining/scripts/mac/UpdateToolNotifier.app/Contents/MacOS/Updatetool
        Sending 2.3sustaining/scripts/updatetool.sh
        Sending 2.3sustaining/updatetool/src/notifier/application.py
        Transmitting file data .....
        Committed revision 2787.

        Show
        Chris Kasso added a comment - There appeared to be two problems: There was a case where the notifier code would return 0 instead of 99 when the image list was empty. On OS X the exit code from the python process was not propagating to the updatetool.sh script. On OS X when updatetool is invoked it uses open to invoke the UpdateToolNotifier.app which in turn execs updatetool.sh with the --macapp option which invokes python. The open method does not return the exit code from the process in which it invoked. Sending 2.3sustaining/scripts/mac/SoftwareUpdate.app/Contents/MacOS/Updatetool Sending 2.3sustaining/scripts/mac/UpdateTool.app/Contents/MacOS/Updatetool Sending 2.3sustaining/scripts/mac/UpdateToolNotifier.app/Contents/MacOS/Updatetool Sending 2.3sustaining/scripts/updatetool.sh Sending 2.3sustaining/updatetool/src/notifier/application.py Transmitting file data ..... Committed revision 2787.
        Hide
        faouzia added a comment -

        when the user image list is empty and after setting the debug to 1, after
        logout/login , the notifier scheduler exits after few minutes as expected on
        MAC-OS using B38c.

        Show
        faouzia added a comment - when the user image list is empty and after setting the debug to 1, after logout/login , the notifier scheduler exits after few minutes as expected on MAC-OS using B38c.

          People

          • Assignee:
            Chris Kasso
            Reporter:
            Chris Kasso
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: