Announcement

Collapse
No announcement yet.

Plug-in updates fail - exe running?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Plug-in updates fail - exe running?

    I have encountered numerous cases where a plug-in update fails because the exe is not accessible with a recommendation to disable the plug-in and try again. Since I routinely disable plug-ins before updating them, that is not a helpful suggestion.

    Bob Maslin has been recommending that his plug-ins be disabled, then HS restarted before attempting an update.

    One thing I've noticed is that in many cases disabling the plug-in leaves its exe running in Task Manager. Today I tried killing the exe of the troublesome plug-in. After that the update proceeded without issue and re-enabling the plug-in was uneventful.

    Can anyone explain what should happen when a plug-in is disabled? Is the exe supposed to be terminated when the plug-in is disabled? Is there a downside to killing the process with Task Manager if disabling the plug-in doesn't do it?
    Mike____________________________________________________________ __________________
    HS3 Pro Edition 3.0.0.548, NUC i3

    HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

    #2
    Blade Plug-in updates

    Hi Uncle Michael,

    Your post was timely. I have been trying to update two plug-ins for a while (BLRing & BLBackup) and I had tried disabling them, but I had not thought about killing the process, as I had assumed that disabling the plug-in would unload all processes. As you found, this does not seem to be the case. I killed a BLRing process and the updates installed without a hitch.

    From other experiences, killing the processes should not have any negative effects on the application or plug-in. I would just advise that after the upgrades to shut down HS and restart to ensure that if there are any potential issues, they are avoided and to ensure thatmodules load in the correct order (if there are any load order priorities).

    Thanks again for your comments, they got me out of a fix.

    Steve

    Comment


      #3
      AFAIK when the plugin is shut down from the interfaces page it will call the ShutdownIO function in the respective plugin. That plugin then decides what to do and how to close itself (it would be a bit unusual for it not to terminate itself), for example in the HS example code they have a variable which determines if the plugin is shutting down, if it is then they come out of an endless loop and then disconnect and shut down the EXE (the End statement right at the end).

      Code:
                  Console.WriteLine("Connected, waiting to be initialized...")
      
                  Do
                      Threading.Thread.Sleep(30)
                  Loop While Client.CommunicationState = HSCF.Communication.Scs.Communication.CommunicationStates.Connected And Not bShutDown
      
                  If Not bShutDown Then
                      gAppAPI.ShutdownIO()
                      Console.WriteLine("Connection lost, exiting")
                  Else : Console.WriteLine("Shutting down plugin")
                  End If
      
                  Client.Disconnect()
                  ClientCallback.Disconnect()
                  Wait(2)
      
                  End
      The second If block seems to be if the connection to the HS server is lost then it will call ShutdownIO anyway just as a safeguard.

      My concern about killing a plugin by task manager (and you probably have little other choice) is that you are potentially not calling ShutdownIO which could have some sort of code in it that could be saving data to files or doing anything that the plugin wants to do if it is shut down (closing connections/ports etc). There may be nothing in this routine but it might have something of importance in.

      One thing I have just noticed is the the Wait call, I've never really looked at it but that is pausing for two seconds before closing and to me it seems a bit of a long time because if you are updating the plugin could it be shutting it down, HS thinks it has shut down because the interface has disconnected but in reality the EXE is actually still alive for a further two seconds because it has not disposed of itself? This would only be relevant if the plugin author is using the HS supplied examples though and it is just something I have noticed that might be an issue or might not.

      Comment


        #4
        Originally posted by mrhappy View Post
        AFAIK when the plugin is shut down from the interfaces page it will call the ShutdownIO function in the respective plugin. That plugin then decides what to do and how to close itself (it would be a bit unusual for it not to terminate itself). . .
        My concern about killing a plugin by task manager (and you probably have little other choice) is that you are potentially not calling ShutdownIO
        Just to be clear, in my case I am disabling the plug-in, then starting the update process. If I get an update failed message that says the exe is in use by another process, I then check Task Manager and find the exe is still running. Only then have I tried killing it. I'm assuming ShutdownIO has already run if it's going to.

        One thing I have just noticed is the the Wait call, I've never really looked at it but that is pausing for two seconds before closing and to me it seems a bit of a long time because if you are updating the plugin could it be shutting it down, HS thinks it has shut down because the interface has disconnected but in reality the EXE is actually still alive for a further two seconds. . .
        I'm finding the exe running minutes after shutting down the plug-in. I'm suspicious that, in some cases (some plug-ins shut down without issue when they are disabled), HS is failing to actually terminate the exe when it is supposed to.
        Mike____________________________________________________________ __________________
        HS3 Pro Edition 3.0.0.548, NUC i3

        HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

        Comment


          #5
          Originally posted by Uncle Michael View Post
          Just to be clear, in my case I am disabling the plug-in, then starting the update process. If I get an update failed message that says the exe is in use by another process, I then check Task Manager and find the exe is still running. Only then have I tried killing it. I'm assuming ShutdownIO has already run if it's going to.

          I'm finding the exe running minutes after shutting down the plug-in. I'm suspicious that, in some cases (some plug-ins shut down without issue when they are disabled), HS is failing to actually terminate the exe when it is supposed to.
          From what I can see from the documentation and the code then all HS does in the interfaces page is call ShutdownIO, HS itself does not terminate the EXE file - that is down to how the plugin has been written and in the case of the HS examples that curious wait is in there and then it decides to End (quite abruptly but imagine that is because any disposing of methods should've been done in the ShutdownIO routine). If you have the console window open (developer mode) does the console window close when you disable the plugin or does that stay open?

          It certainly shouldn't be carrying on for minutes but from what I see I am not sure it is a HS issue and could instead be a plugin issue.

          Comment


            #6
            Originally posted by mrhappy View Post
            If you have the console window open (developer mode) does the console window close when you disable the plugin or does that stay open?
            That's an interesting question. I just tried it, but of course, now the exe terminates no matter what I do - at least for the plug-ins I tried.
            Mike____________________________________________________________ __________________
            HS3 Pro Edition 3.0.0.548, NUC i3

            HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

            Comment

            Working...
            X