Ankündigung

Einklappen
Keine Ankündigung bisher.

SmarthomeNG beenden schlägt fehl

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    SmarthomeNG beenden schlägt fehl

    Hallo,

    mein SmarthomeNG ist sehr störrisch beim beenden.
    Umgebung:
    Core: Master von heute
    Plugin: Develop von heute
    Python 3.5.3
    Ubuntu Server
    Das Problem tritt aber eigentlich schon seit sehr langer Zeit auf.


    Beispiel:
    SmarthomeNG im interactive mode:

    STRG + C

    Code:
    2017-12-28 15:36:40 INFO     smarthome    Main         stop: Number of Threads: 34 -- smarthome.py:stop:498
    2017-12-28 15:36:40 INFO     plugin       Main         Stop plugins -- plugin.py:stop:306
    2017-12-28 15:36:40 INFO     service      Main         Alexa: service stopping -- service.py:stop:31
    2017-12-28 15:36:41 WARNING  module       Main         Stop Modules -- module.py:stop:337
    2017-12-28 15:36:41 INFO     __init__     Main         http: Shutting down -- __init__.py:stop:610
    [28/Dec/2017:15:36:41] ENGINE Bus STOPPING
    2017-12-28 15:36:41 INFO     _cplogging   Main         [28/Dec/2017:15:36:41] ENGINE Bus STOPPING -- _cplogging.py:error:214
    [28/Dec/2017:15:36:41] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('192.168.6.99', 8384)) shut down
    2017-12-28 15:36:41 INFO     _cplogging   Main         [28/Dec/2017:15:36:41] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('192.168.6.99', 8384)) shut down -- _cplogging.py:error:214
    [28/Dec/2017:15:36:41] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('192.168.6.99', 8383)) shut down
    2017-12-28 15:36:41 INFO     _cplogging   Main         [28/Dec/2017:15:36:41] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('192.168.6.99', 8383)) shut down -- _cplogging.py:error:214
    [28/Dec/2017:15:36:41] ENGINE Stopped thread '_TimeoutMonitor'.
    2017-12-28 15:36:41 INFO     _cplogging   Main         [28/Dec/2017:15:36:41] ENGINE Stopped thread '_TimeoutMonitor'. -- _cplogging.py:error:214
    [28/Dec/2017:15:36:41] ENGINE Bus STOPPED
    2017-12-28 15:36:41 INFO     _cplogging   Main         [28/Dec/2017:15:36:41] ENGINE Bus STOPPED -- _cplogging.py:error:214
    [28/Dec/2017:15:36:41] ENGINE Bus EXITING
    2017-12-28 15:36:41 INFO     _cplogging   Main         [28/Dec/2017:15:36:41] ENGINE Bus EXITING -- _cplogging.py:error:214
    [28/Dec/2017:15:36:41] ENGINE Bus EXITED
    2017-12-28 15:36:41 INFO     _cplogging   Main         [28/Dec/2017:15:36:41] ENGINE Bus EXITED -- _cplogging.py:error:214
    2017-12-28 15:36:46 WARNING  smarthome    Main         The following threads have not been terminated propperly by their plugins (please report to the plugin's author): -- smarthome.py:stop:535
    2017-12-28 15:36:46 WARNING  smarthome    Main         -Thread: Thread-29, still alive -- smarthome.py:stop:537
    2017-12-28 15:36:46 WARNING  smarthome    Main         -Thread: MonitoringService_avm_fritzbox_7490, still alive -- smarthome.py:stop:537
    2017-12-28 15:36:46 WARNING  smarthome    Main         -Thread: Thread-28, still alive -- smarthome.py:stop:537
    2017-12-28 15:36:46 WARNING  smarthome    Main         -Thread: Thread-30, still alive -- smarthome.py:stop:537
    2017-12-28 15:36:46 WARNING  smarthome    Main         SmartHomeNG stopped -- smarthome.py:stop:539
    Nach einigen Minuten: Nichts weiter passiert. Smarthome.py läuft weiter - console blockiert noch.
    Wieder STRG + C

    Code:
    ^C2017-12-28 15:40:34 INFO     smarthome    Main         stop: Number of Threads: 5 -- smarthome.py:stop:498
    2017-12-28 15:40:34 INFO     plugin       Main         Stop plugins -- plugin.py:stop:306
    2017-12-28 15:40:34 INFO     service      Main         Alexa: service stopping -- service.py:stop:31
    2017-12-28 15:40:34 WARNING  module       Main         Stop Modules -- module.py:stop:337
    2017-12-28 15:40:34 INFO     __init__     Main         http: Shutting down -- __init__.py:stop:610
    [28/Dec/2017:15:40:34] ENGINE Bus STOPPING
    2017-12-28 15:40:34 INFO     _cplogging   Main         [28/Dec/2017:15:40:34] ENGINE Bus STOPPING -- _cplogging.py:error:214
    [28/Dec/2017:15:40:34] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('192.168.6.99', 8384)) already shut down
    2017-12-28 15:40:34 INFO     _cplogging   Main         [28/Dec/2017:15:40:34] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('192.168.6.99', 8384)) already shut down -- _cplogging.py:error:214
    [28/Dec/2017:15:40:34] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('192.168.6.99', 8383)) already shut down
    2017-12-28 15:40:34 INFO     _cplogging   Main         [28/Dec/2017:15:40:34] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('192.168.6.99', 8383)) already shut down -- _cplogging.py:error:214
    [28/Dec/2017:15:40:34] ENGINE No thread running for None.
    2017-12-28 15:40:34 INFO     _cplogging   Main         [28/Dec/2017:15:40:34] ENGINE No thread running for None. -- _cplogging.py:error:214
    [28/Dec/2017:15:40:34] ENGINE Bus STOPPED
    2017-12-28 15:40:34 INFO     _cplogging   Main         [28/Dec/2017:15:40:34] ENGINE Bus STOPPED -- _cplogging.py:error:214
    [28/Dec/2017:15:40:34] ENGINE Bus EXITING
    2017-12-28 15:40:34 INFO     _cplogging   Main         [28/Dec/2017:15:40:34] ENGINE Bus EXITING -- _cplogging.py:error:214
    [28/Dec/2017:15:40:34] ENGINE Bus EXITED
    2017-12-28 15:40:34 INFO     _cplogging   Main         [28/Dec/2017:15:40:34] ENGINE Bus EXITED -- _cplogging.py:error:214
    2017-12-28 15:40:38 WARNING  smarthome    Main         The following threads have not been terminated propperly by their plugins (please report to the plugin's author): -- smarthome.py:stop:535
    2017-12-28 15:40:38 WARNING  smarthome    Main         -Thread: Thread-29, still alive -- smarthome.py:stop:537
    2017-12-28 15:40:38 WARNING  smarthome    Main         -Thread: MonitoringService_avm_fritzbox_7490, still alive -- smarthome.py:stop:537
    2017-12-28 15:40:38 WARNING  smarthome    Main         -Thread: Thread-28, still alive -- smarthome.py:stop:537
    2017-12-28 15:40:38 WARNING  smarthome    Main         -Thread: Thread-30, still alive -- smarthome.py:stop:537
    2017-12-28 15:40:38 WARNING  smarthome    Main         SmartHomeNG stopped -- smarthome.py:stop:539
    Exception ignored in: <module 'threading' from '/usr/lib/python3.5/threading.py'>
    Traceback (most recent call last):
      File "/usr/lib/python3.5/threading.py", line 1288, in _shutdown
        t.join()
      File "/usr/lib/python3.5/threading.py", line 1054, in join
        self._wait_for_tstate_lock()
      File "/usr/lib/python3.5/threading.py", line 1070, in _wait_for_tstate_lock
        elif lock.acquire(block, timeout):
      File "/usr/local/bin/smarthome.py", line 546, in stop
        exit()
      File "/usr/lib/python3.5/_sitebuiltins.py", line 26, in __call__
        raise SystemExit(code)
    SystemExit: None
    Dann terminiert der Prozess.

    Ich konnte folgendes eingrenzen:
    Das Problem tritt insbesondere dann auf, wenn Plugins aktiviert sind, die einen HTTP Socket bereitstellen (Backend, Alexa, Firtzbox etc). Es scheint so, als ob SmarthomeNG diese Kindsprozesse nicht sauber beenden kann.

    Tritt dieses Verhalten bei euch auch auf? Anhand der Logs gehe ich davon aus, dass die Core Entwickler das Thema kennen.
    Kann man etwas dagegen tun? Workaround/Fix?


    Liebe Grüße

    mode
    Zuletzt geändert von mode; 28.12.2017, 17:17.

    #2
    Vorbemerkung: Master und Develp mischen kann funktioniern, muss aber nicht. Wenn Du den Core vom Master hast, solltest Du auch die Plugins vom Master nutzen. Solche Mischungen können wir nicht sinnvoll supporten.

    Es gibt Plugins die sich nicht beenden können. Ich sehe, dass bei Dir 3 Threads, die am Ende hart gekillt werden. Welche Plugins nutzt Du? (Bitte die vollständige Liste und nicht Deine Verdachtskandidaten).
    Zuletzt geändert von Msinn; 28.12.2017, 19:18. Grund: Typo beseitigt
    Viele Grüße
    Martin

    There is no cloud. It's only someone else's computer.

    Kommentar


      #3
      Riecht verdächtig nach dem Telegram Plugin ... :-)

      Kommentar


        #4
        Genau daran dachte ich auch.
        Viele Grüße
        Martin

        There is no cloud. It's only someone else's computer.

        Kommentar


          #5
          Ich nutze aktuell:
          • knx
          • onewire
          • alexa
          • backend
          • telegram
          • network
          • cli
          • sql
          • WebSocket (Visu)
          • Solarlog
          • iCal
          • AVM
          • ArtNet
          • Enigma2
          Wie kann ich herausfinden welcher Thread zu welchem Plugin gehört?

          Kommentar


            #6
            Ok, ist das telegram plugin. das macht 3 Threads auf, die nicht benannt sind und sich nicht beenden lassen.
            Viele Grüße
            Martin

            There is no cloud. It's only someone else's computer.

            Kommentar


              #7
              Da muß dann halt jemand das Plugin mal umbauen ...

              Kommentar


                #8
                Die Threads macht aber nicht das Plugin selber auf sondern die telepot lib die vom Plugin genutzt wird (siehe requirements.txt). Das macht die Sache nicht einfacher, da telepot nur per close() die Verbindung schließen kann, jedoch keine Möglichkeit hat sich selber sauber zu beenden.
                Viele Grüße
                Martin

                There is no cloud. It's only someone else's computer.

                Kommentar


                  #9
                  Es gibt alternative Libraries und/oder alternative Nutzung der telepot. So wie es nun läuft, ist es halt einfach zu implementieren.

                  Kommentar

                  Lädt...
                  X