Skip to contentSkip to conversation

toaster: broken custom.xml and threads patch

PATCH In review David Reyna 2 participants 4 messages May 29, 2018

lore
Share & tools
lore
#0 lore raw

cover toaster: broken custom.xml and threads patch

From: David Reyna <[email protected]>

The Toaster for Rocko is broken on HEAD. There are two patches that made it into master and Sumo, but missed Rocko.

The first patch fixes an error that breaks the initialization of Toaster.
The second patches fixes a change in behaviour for Django that creates an extra thread that blocks Toaster from shutting down.

The following changes since commit 7e7ee662f5dea4d090293045f7498093322802cc:

build-appliance-image: Update to rocko head revision (2018-05-23 17:46:34 +0100)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib dreyna/submit/dreyna/toaster/broken_customxml_threads_12751_patch
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=dreyna/submit/dreyna/toaster/broken_customxml_threads_12751_patch

David Reyna (2):
bitbake: toaster: do not fail on optional 'custom.xml' file
bitbake: Toaster: fix shutdown and extra threads

 bin/toaster                                                 | 4 ++--
 lib/toaster/bldcontrol/management/commands/checksettings.py | 5 ++++-
 2 files changed, 6 insertions(+), 3 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/2 bitbake: toaster: do not fail on optional 'custom.xml' file

From: David Reyna <[email protected]>

Explicitly capture and ignore errors when trying to load the optional 'custom.xml' fixture file.

[YOCTO #12554]

(Bitbake rev: 132458939d3987ebc58685397714af3d6d5cd8fd)

---
 lib/toaster/bldcontrol/management/commands/checksettings.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
lib/toaster/bldcontrol/management/commands/checksettings.py +4 -1
index 582114a..823c6f1 100644
@@ -107,7 +107,10 @@ class Command(BaseCommand):
                                 action="ignore",
                                 message="^.*No fixture named.*$")
                             print("Importing custom settings if present")
-                            call_command("loaddata", "custom")
+                            try:
+                                call_command("loaddata", "custom")
+                            except:
+                                print("NOTE: optional fixture 'custom' not found")
 
                         # we run lsupdates after config update
                         print("\nFetching information from the layer index, "
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/2 bitbake: Toaster: fix shutdown and extra threads

In reply to David Reyna

From: David Reyna <[email protected]>

Fix typo in shutdown code to kill threads when "kill -0" is not enough. Use the '--noreload' flag for 'runserver' so that there are no extra and unaccounted threads.

[YOCTO #12555]

(Bitbake rev: 256990943075e89cb9aee2bc6488344b6783e07b)

---
 bin/toaster | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
bin/toaster +2 -2
index 4036f0a..ed365ee 100755
@@ -68,7 +68,7 @@ webserverKillAll()
         if [ -f ${pidfile} ]; then
             pid=`cat ${pidfile}`
             while kill -0 $pid 2>/dev/null; do
-                kill -SIGTERM -$pid 2>/dev/null
+                kill -SIGTERM $pid 2>/dev/null
                 sleep 1
             done
             rm  ${pidfile}
@@ -91,7 +91,7 @@ webserverStartAll()
 
     echo "Starting webserver..."
 
-    $MANAGE runserver "$ADDR_PORT" \
+    $MANAGE runserver --noreload "$ADDR_PORT" \
            </dev/null >>${BUILDDIR}/toaster_web.log 2>&1 \
            & echo $! >${BUILDDIR}/.toastermain.pid
 
Signature · 1 line
1.9.1
#3 lore raw
In reply to David Reyna
Quoted 10 lines · David Reyna

From: David Reyna <[email protected]>

The Toaster for Rocko is broken on HEAD. There are two patches that made it into master and Sumo, but missed Rocko.

The first patch fixes an error that breaks the initialization of Toaster.
The second patches fixes a change in behaviour for Django that creates an extra thread that blocks Toaster from shutting down.

The following changes since commit 7e7ee662f5dea4d090293045f7498093322802cc:

build-appliance-image: Update to rocko head revision (2018-05-23 17:46:34 +0100)

thanks for the head up.

- armin

Quoted 14 lines

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib dreyna/submit/dreyna/toaster/broken_customxml_threads_12751_patch
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=dreyna/submit/dreyna/toaster/broken_customxml_threads_12751_patch

David Reyna (2):
bitbake: toaster: do not fail on optional 'custom.xml' file
bitbake: Toaster: fix shutdown and extra threads

 bin/toaster                                                 | 4 ++--
 lib/toaster/bldcontrol/management/commands/checksettings.py | 5 ++++-
 2 files changed, 6 insertions(+), 3 deletions(-)