Bug 6274

Summary: Bitbake background tasks are not killed when ssh connection is dropped
Product: [Build System, Metadata & Runtime] BitBake Reporter: Ming Liu <ming.liu>
Component: bitbakeAssignee: Richard Purdie <richard.purdie>
Status: RESOLVED NOTABUG QA Contact:
Severity: normal    
Priority: Medium CC: bluelightning, jessica.zhang, meta.mr.watcher, meta.watcher, poky.bs.watcher, poky.watcher
Version: 1.7   
Target Milestone: 1.7   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Ming Liu 2014-05-07 02:46:55 UTC
Test is based on commit: 82813d27640549255dc81a15d7fb63688431f747

How to reproduce:
1 login a build server via ssh, run:
$ bitbake bash -c devshell
$ ps aux | grep mliu3
......
mliu3     4971  3.0  0.0 319180 110472 pts/67  S+   10:34   0:01 python /buildarea4/mliu3/openembedded-core/bitbake/bin/bitbake bash -c devshell
mliu3     6373 26.3  0.2 839248 376280 pts/67  Sl+  10:34   0:12 python /buildarea4/mliu3/openembedded-core/bitbake/bin/bitbake bash -c devshell
mliu3    21779  5.6  0.1 248160 158452 pts/67  S+   10:34   0:01 python /buildarea4/mliu3/openembedded-core/bitbake/bin/bitbake-worker decafbad
mliu3    23013  0.8  0.1 248164 156924 pts/67  S    10:34   0:00 python /buildarea4/mliu3/openembedded-core/bitbake/bin/bitbake-worker decafbad
mliu3    23324  0.0  0.0      0     0 pts/67   Z    10:34   0:00 [gnome-terminal] <defunct>
mliu3    23421  0.0  0.0  26532  1856 ?        Ss   10:34   0:00 SCREEN -D -m -t OpenEmbedded Developer Shell -S devshell_23013 /buildarea4/mliu3/openembedded-core/build/tmp-eglibc/work/core2-64-oe-linux/bash/4.3-r0/temp/run.do_terminal.23013
mliu3    23434  0.0  0.0 122952  1228 pts/67   S+   10:34   0:00 screen -r devshell_23013
mliu3    23438  0.0  0.0  13960  2056 pts/77   Ss+  10:34   0:00 /bin/bash
mliu3    23518  0.0  0.0   9996  2184 ?        Ss   10:34   0:00 /buildarea4/mliu3/openembedded-core/build/tmp-eglibc/sysroots/x86_64-linux/usr/bin/pseudo -d
......

2 then the ssh connection is closed for some reasons, then run:
$ ps aux | grep mliu3
......
mliu3    23013  0.3  0.1 248164 156924 ?       S    10:34   0:00 python /buildarea4/mliu3/openembedded-core/bitbake/bin/bitbake-worker decafbad
mliu3    23324  0.0  0.0      0     0 ?        Z    10:34   0:00 [gnome-terminal] <defunct>
mliu3    23421  0.0  0.0  26532  1860 ?        Ss   10:34   0:00 SCREEN -D -m -t OpenEmbedded Developer Shell -S devshell_23013 /buildarea4/mliu3/openembedded-core/build/tmp-eglibc/work/core2-64-oe-linux/bash/4.3-r0/temp/run.do_terminal.23013
mliu3    23438  0.0  0.0  13960  2056 pts/77   Ss+  10:34   0:00 /bin/bash
mliu3    23518  0.0  0.0   9996  2184 ?        Ss   10:34   0:00 /buildarea4/mliu3/openembedded-core/build/tmp-eglibc/sysroots/x86_64-linux/usr/bin/pseudo -d
......

there are still some tasks running on the background, should they exit with the closed terminal session?
Comment 1 Ming Liu 2014-06-23 10:05:41 UTC
I just found that the ternimal is spawned with "SCREEN -D -m -t", that is saying it's forced to run in a new session, so maybe this is should not be regarded as a defect?
Comment 2 Richard Purdie 2014-09-24 17:04:56 UTC
Since this has been configured with screen as the interactive terminal, I don't think this is a bug, no. Closing as such.