If any of those three parameters is different (i.e., waitAppCompletion removed, connection file mode is changed to pull or on IOP cluster), then the kernel works fine.
@liukun1016 I'm hoping you can take look - first by reproducing, then probably by adding some tracing in the launcher, etc.
Due to this issue, I plan on changing the connection file mode on Scala kernels to pull
when delivering changes for #48.
Here's an excerpt from the log showing the reception of the json connection info with no additional kernel activity entries...
[D 2017-07-10 08:08:57.949 KernelGatewayApp] Waiting for application_1499374582831_0027 to connect back to receive connection info...
[D 2017-07-10 08:08:58.967 KernelGatewayApp] KernelID=b351d958-8361-4ced-9cf5-1bcf947deb03, ApplicationID=application_1499374582831_0027, AssignedHost=elyra-fyi-node-5.fyre.ibm.com, CurrentState=RUNNING, Attempt=14
[D 2017-07-10 08:08:58.967 KernelGatewayApp] Connected to ('172.16.190.45', 48714)...
[D 2017-07-10 08:08:58.968 KernelGatewayApp] Connected to ('172.16.190.45', 48714)...
[D 2017-07-10 08:08:58.969 KernelGatewayApp] RemoteKernelManager: Writing connection file with ip=172.16.190.45, control=33269, hb=36826, iopub=33802, stdin=41918, shell=33198
[D 2017-07-10 08:08:58.969 KernelGatewayApp] Successfully updated connection file '/var/run/elyra/runtime/kernel-b351d958-8361-4ced-9cf5-1bcf947deb03.json'.
[D 2017-07-10 08:08:58.971 KernelGatewayApp] Connecting to: tcp://172.16.190.45:33269
[D 2017-07-10 08:08:58.972 KernelGatewayApp] Connecting to: tcp://172.16.190.45:33802
[I 2017-07-10 08:08:58.974 KernelGatewayApp] Kernel started: b351d958-8361-4ced-9cf5-1bcf947deb03
[D 2017-07-10 08:08:58.974 KernelGatewayApp] Kernel args: {'kernel_name': u'spark_2.1_scala_yarn_cluster', 'env': {'HOSTNAME': 'elyra-fyi-node-1.fyre.ibm.com', 'NO_PROXY': 'localhost,127.0.0.1,.fyre.ibm.com', 'http_proxy': 'http://proxy1.fyre.ibm.com:3128', 'FTP_PROXY': 'http://proxy1.fyre.ibm.com:3128', 'LESSOPEN': '||/usr/bin/lesspipe.sh %s', 'ELYRA_REMOTE_USER': 'elyra', 'ELYRA_REMOTE_HOSTS': 'elyra-fyi-node-1,elyra-fyi-node-2,elyra-fyi-node-3,elyra-fyi-node-4,elyra-fyi-node-5', 'LOGNAME': 'elyra', 'USER': 'elyra', 'QTDIR': '/usr/lib64/qt-3.3', 'PATH': '/opt/anaconda2/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/elyra/.local/bin:/home/elyra/bin', 'LANG': 'en_US.UTF-8', 'QTLIB': '/usr/lib64/qt-3.3/lib', 'TERM': 'xterm-256color', 'SHELL': '/bin/bash', 'ELYRA_PROXY_LAUNCH_LOG': '/var/log/elyra/proxy_launch_2017-07-09.log', 'SHLVL': '2', 'HISTSIZE': '1000', 'KERNEL_ID': u'b351d958-8361-4ced-9cf5-1bcf947deb03', 'ELYRA_YARN_ENDPOINT': 'http://elyra-fyi-node-1:8088/ws/v1/cluster', 'HOME': '/home/elyra', 'no_proxy': 'localhost,127.0.0.1,.fyre.ibm.com', 'QT_GRAPHICSSYSTEM': 'native', 'JUPYTER_DATA_DIR': '/var/lib/elyra', 'ftp_proxy': 'http://proxy1.fyre.ibm.com:3128', u'KERNEL_USERNAME': u'Foo', 'ELYRA_KERNEL_LAUNCH_TIMEOUT': '90', 'MAIL': '/var/spool/mail/elyra', 'QT_GRAPHICSSYSTEM_CHECKED': '1', 'XDG_SESSION_ID': '987', '_': '/opt/anaconda2/bin/jupyter', 'HTTP_PROXY': 'http://proxy1.fyre.ibm.com:3128', 'HISTCONTROL': 'ignoredups', 'QTINC': '/usr/lib64/qt-3.3/include', 'PWD': '/home/elyra', 'JUPYTER_RUNTIME_DIR': '/var/run/elyra/runtime'}}
[I 170710 08:08:58 web:2063] 201 POST /api/kernels (9.108.95.126) 16935.83ms
[I 170710 08:08:59 web:2063] 200 GET /api/kernels/b351d958-8361-4ced-9cf5-1bcf947deb03 (9.108.95.126) 1.10ms
[D 2017-07-10 08:08:59.201 KernelGatewayApp] Initializing websocket connection /api/kernels/b351d958-8361-4ced-9cf5-1bcf947deb03/channels
[W 2017-07-10 08:08:59.203 KernelGatewayApp] No session ID specified
[D 2017-07-10 08:08:59.204 KernelGatewayApp] Requesting kernel info from b351d958-8361-4ced-9cf5-1bcf947deb03
[D 2017-07-10 08:08:59.204 KernelGatewayApp] Connecting to: tcp://172.16.190.45:33198
[D 2017-07-10 08:09:06.398 KernelGatewayApp] Polling every 30 seconds for kernels idle > 600 seconds...
[D 2017-07-10 08:09:06.398 KernelGatewayApp] kernel_id=b351d958-8361-4ced-9cf5-1bcf947deb03, kernel_name=spark_2.1_scala_yarn_cluster, last_activity=2017-07-10 15:08:58.972078+00:00
[W 2017-07-10 08:09:09.206 KernelGatewayApp] Timeout waiting for kernel_info reply from b351d958-8361-4ced-9cf5-1bcf947deb03
[I 170710 08:09:09 web:2063] 101 GET /api/kernels/b351d958-8361-4ced-9cf5-1bcf947deb03/channels (9.108.95.126) 10006.78ms
[D 2017-07-10 08:09:09.208 KernelGatewayApp] Opening websocket /api/kernels/b351d958-8361-4ced-9cf5-1bcf947deb03/channels
[D 2017-07-10 08:09:09.209 KernelGatewayApp] Connecting to: tcp://172.16.190.45:33198
[D 2017-07-10 08:09:09.209 KernelGatewayApp] Connecting to: tcp://172.16.190.45:33802
[D 2017-07-10 08:09:09.210 KernelGatewayApp] Connecting to: tcp://172.16.190.45:41918
[D 2017-07-10 08:09:36.397 KernelGatewayApp] Polling every 30 seconds for kernels idle > 600 seconds...
[D 2017-07-10 08:09:36.398 KernelGatewayApp] kernel_id=b351d958-8361-4ced-9cf5-1bcf947deb03, kernel_name=spark_2.1_scala_yarn_cluster, last_activity=2017-07-10 15:08:58.972078+00:00