Nightly 066: When closing NINA without prior device disconnect process keeps running

Issue #839 closed
Ruediger created an issue

Hi all,

I noticed when closing NINA with the “X” without disconnecting all the devices before, the profile is kept open by a NINA process and you cannot load it when restarting NINA. You have to manually kill the process first.

This is not a problem of the latest version. It existed in the version before too.

Cheers
Rüdiger

Comments (28)

  1. Ruediger reporter

    The last test was with connected focuser only. When the camera is connected, NINA asks whether I really want to disconnect. So there the problem is not present.

  2. Stefan B repo owner

    Well closing the app does disconnect all devices either way. I wonder what is keeping the app open…

  3. Stefan B repo owner

    Does it also happen when you connect a different device or only when the focuser is connected?

  4. Ruediger reporter

    With the quick test here, I could only provoke it with the focuser. Other items get properly disconnected when closing.

    But I have to admit I can only do partial testing, since the Equipment is in the house due to bad weather.

  5. Ruediger reporter

    Hi Stefan,

    just re-tested. The problem is 100% reproduceable when focuser is connected. Closing via “x” will cause the profile to be blocked by the process.

  6. Stefan B repo owner

    Sounds like the driver doesn’t dispose all resources then. As i can’t reproduce this on my side with ascom simulators it looks like some issue inside the focuser driver..

  7. Ruediger reporter

    But one question: Why does the problem occur only when exiting by closing the window via “x”?
    If I disconnect manually before closing, it is working as expected. So there must be a difference between the implicit and and the explicit disconnect.

  8. Stefan B repo owner

    Can you do another test?

    Connect your equipment, then hit F9 key to disconnect all and then close the application and check if it closed correctly? Just want to rule out that it is related to that piece of shared code.

  9. Ruediger reporter

    Yes, just tested multiple times: When using F9 and do a explicit disconnect, everything is fine and no NINA task is running. On next load the profile can be loaded.

    Crosscheck: Leaving with “x” (closing the window) leads to the open task and blocked profile.

  10. Stefan B repo owner

    Could you also attach the log file on a successful closure of the app and one where the app was not closed properly?

  11. Ruediger reporter

    I have attached three log

    1. hard closure via “x”
    2. the followed failed open profile on next start
    3. clean exit via F9

  12. Stefan B repo owner

    in the hard closure via x – did you connect the focuser, disconnect the focuser, connected again and then closed the app?

    does the problem also happen when you just connect the focuser once and then disconnect?

  13. Ruediger reporter

    I have only clicked once to connect. Nothing more, then immediately closed NINA.

    No manual connect, disconnect, re-connect, close.

    I have redone the test and attach the log.

  14. Stefan B repo owner

    I have compiled a version with a potential fix. The root cause is most likely that the disconnection is done inside asynchronous tasks, however they were not properly awaited for in the closing event of the application and therefore were never finished or even called.

    You can extract this zip file and could have a look if it works.

    https://www.dropbox.com/s/pwg7s17bbjcj10i/Release.zip?dl=0

  15. Stefan B repo owner

    Great - i will put the fixes into the next nightly build. Thank you for the feedback and retest.

  16. Log in to comment