Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26725] Android: Liveview closes file/event server process after the first app reload & stops working

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionFixed
Resolution Date2019-01-17T22:55:30.000+0000
Affected Version/sRelease 8.0.0
Fix Version/sRelease 8.0.0
ComponentsLiveView
Labelsn/a
ReporterLokesh Choudhary
AssigneeEwan Harris
Created2019-01-14T19:18:30.000+0000
Updated2019-01-23T18:43:54.000+0000

Description

NOTE: To make liveview work with 8.0.0 use latest studio 5.1.2 from jenkins.

Steps to reproduce:

1. Create a default app. 2. Enable liveview. 3. Build for android device/emulator. 4. After the app launches make changes to initiate app reload. 5. Make another change & again initiate app reload.

Actual results:

1. Liveview closes the file/event server process & stops working :
[LiveView] Closing file/event server process id: 49697
2. I also get these warnings:
[WARN] :   [Pixel] W/System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'java.io.InputStream java.net.Socket.getInputStream()' on a null object reference
[WARN] :   [Pixel] W/System.err: 	at ti.modules.titanium.network.socket.TCPProxy.readSync(TCPProxy.java:392)
[WARN] :   [Pixel] W/System.err: 	at ti.modules.titanium.stream.StreamModule.pumpSync(StreamModule.java:359)
[WARN] :   [Pixel] W/System.err: 	at ti.modules.titanium.stream.StreamModule.access$300(StreamModule.java:24)
[WARN] :   [Pixel] W/System.err: 	at ti.modules.titanium.stream.StreamModule$3.run(StreamModule.java:343)
[WARN] :   [Pixel] W/System.err: 	at java.lang.Thread.run(Thread.java:764)

Expected result:

1. Liveview should not close the file/event server & work as expected. Additional logs:
[LiveView] Closing file/event server process id: 51218
    at Object._errnoException (util.js:1024:11)
    at process.kill (internal/process.js:183:18)
    at /Users/lchoudhary/Library/Application Support/Titanium/mobilesdk/osx/8.0.0.v20190114044343/node_modules/liveview/lib/fserver.js:103:12
    at Array.forEach (<anonymous>)
    at Object.FServer.stop (/Users/lchoudhary/Library/Application Support/Titanium/mobilesdk/osx/8.0.0.v20190114044343/node_modules/liveview/lib/fserver.js:98:7)
    at Timeout.<anonymous> (/Users/lchoudhary/Library/Application Support/Titanium/mobilesdk/osx/8.0.0.v20190114044343/node_modules/liveview/lib/fserver.js:354:13)
    at ontimeout (timers.js:475:11)
    at tryOnTimeout (timers.js:310:5)
    at Timer.listOnTimeout (timers.js:270:5)
---------------------------------------------
    at Socket.<anonymous> (/Users/lchoudhary/Library/Application Support/Titanium/mobilesdk/osx/8.0.0.v20190114044343/node_modules/liveview/lib/fserver.js:353:20)
    at emitNone (events.js:111:20)
    at Socket.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1056:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickDomainCallback (internal/process/next_tick.js:218:9)
---------------------------------------------
    at Socket.Readable.on (_stream_readable.js:772:35)
    at Server.<anonymous> (/Users/lchoudhary/Library/Application Support/Titanium/mobilesdk/osx/8.0.0.v20190114044343/node_modules/liveview/lib/fserver.js:348:10)
    at emitOne (events.js:116:13)
    at Server.emit (events.js:211:7)
    at TCP.onconnection (net.js:1561:8)
---------------------------------------------
    at Object.FServer.start (/Users/lchoudhary/Library/Application Support/Titanium/mobilesdk/osx/8.0.0.v20190114044343/node_modules/liveview/lib/fserver.js:341:12)
    at startServer (/Users/lchoudhary/Library/Application Support/Titanium/mobilesdk/osx/8.0.0.v20190114044343/node_modules/liveview/hook/lvhook.js:225:11)
    at ClientRequest.<anonymous> (/Users/lchoudhary/Library/Application Support/Titanium/mobilesdk/osx/8.0.0.v20190114044343/node_modules/liveview/hook/lvhook.js:182:6)
    at emitNone (events.js:106:13)
    at ClientRequest.emit (events.js:208:7)
    at Socket.socketCloseListener (_http_client.js:350:7)
    at emitOne (events.js:121:20)
---------------------------------------------
    at Domain.<anonymous> (/Users/lchoudhary/Library/Application Support/Titanium/mobilesdk/osx/8.0.0.v20190114044343/node_modules/liveview/hook/lvhook.js:181:6)
    at Domain.run (domain.js:242:14)
    at /Users/lchoudhary/Library/Application Support/Titanium/mobilesdk/osx/8.0.0.v20190114044343/node_modules/liveview/hook/lvhook.js:176:10
    at /Users/lchoudhary/.appcelerator/install/7.0.9/package/node_modules/titanium/lib/hook.js:235:13
    at /Users/lchoudhary/.appcelerator/install/7.0.9/package/node_modules/titanium/node_modules/async/dist/async.js:3845:9
    at replenish (/Users/lchoudhary/.appcelerator/install/7.0.9/package/node_modules/titanium/node_modules/async/dist/async.js:1030:17)
    at /Users/lchoudhary/.appcelerator/install/7.0.9/package/node_modules/titanium/node_modules/async/dist/async.js:1034:9
    at eachOfLimit (/Users/lchoudhary/.appcelerator/install/7.0.9/package/node_modules/titanium/node_modules/async/dist/async.js:1061:22)
    at /Users/lchoudhary/.appcelerator/install/7.0.9/package/node_modules/titanium/node_modules/async/dist/async.js:1066:16 code: 'ESRCH', errno: 'ESRCH', syscall: 'kill' }
[LiveView] Error closing server { Error: kill ESRCH
    at Object._errnoException (util.js:1024:11)
    at process.kill (internal/process.js:183:18)
    at /Users/lchoudhary/Library/Application Support/Titanium/mobilesdk/osx/8.0.0.v20190114044343/node_modules/liveview/lib/fserver.js:103:12
    at Array.forEach (<anonymous>)
    at Object.FServer.stop (/Users/lchoudhary/Library/Application Support/Titanium/mobilesdk/osx/8.0.0.v20190114044343/node_modules/liveview/lib/fserver.js:98:7)
    at Timeout.<anonymous> (/Users/lchoudhary/Library/Application Support/Titanium/mobilesdk/osx/8.0.0.v20190114044343/node_modules/liveview/lib/fserver.js:354:13)
[LiveView] Closing file/event server process id: 51521
    at ontimeout (timers.js:475:11)
    at tryOnTimeout (timers.js:310:5)
    at Timer.listOnTimeout (timers.js:270:5)
---------------------------------------------
    at Socket.<anonymous> (/Users/lchoudhary/Library/Application Support/Titanium/mobilesdk/osx/8.0.0.v20190114044343/node_modules/liveview/lib/fserver.js:353:20)
    at emitNone (events.js:111:20)
    at Socket.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1056:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickDomainCallback (internal/process/next_tick.js:218:9)
---------------------------------------------
    at Socket.Readable.on (_stream_readable.js:772:35)
    at Server.<anonymous> (/Users/lchoudhary/Library/Application Support/Titanium/mobilesdk/osx/8.0.0.v20190114044343/node_modules/liveview/lib/fserver.js:348:10)
    at emitOne (events.js:116:13)
    at Server.emit (events.js:211:7)
    at TCP.onconnection (net.js:1561:8)
---------------------------------------------
    at Object.FServer.start (/Users/lchoudhary/Library/Application Support/Titanium/mobilesdk/osx/8.0.0.v20190114044343/node_modules/liveview/lib/fserver.js:341:12)
    at startServer (/Users/lchoudhary/Library/Application Support/Titanium/mobilesdk/osx/8.0.0.v20190114044343/node_modules/liveview/hook/lvhook.js:225:11)
    at ClientRequest.<anonymous> (/Users/lchoudhary/Library/Application Support/Titanium/mobilesdk/osx/8.0.0.v20190114044343/node_modules/liveview/hook/lvhook.js:182:6)
    at emitNone (events.js:106:13)
    at ClientRequest.emit (events.js:208:7)
    at Socket.socketCloseListener (_http_client.js:350:7)
    at emitOne (events.js:121:20)
---------------------------------------------
    at Domain.<anonymous> (/Users/lchoudhary/Library/Application Support/Titanium/mobilesdk/osx/8.0.0.v20190114044343/node_modules/liveview/hook/lvhook.js:181:6)
    at Domain.run (domain.js:242:14)
    at /Users/lchoudhary/Library/Application Support/Titanium/mobilesdk/osx/8.0.0.v20190114044343/node_modules/liveview/hook/lvhook.js:176:10
    at /Users/lchoudhary/.appcelerator/install/7.0.9/package/node_modules/titanium/lib/hook.js:235:13
    at /Users/lchoudhary/.appcelerator/install/7.0.9/package/node_modules/titanium/node_modules/async/dist/async.js:3845:9
    at replenish (/Users/lchoudhary/.appcelerator/install/7.0.9/package/node_modules/titanium/node_modules/async/dist/async.js:1030:17)
    at /Users/lchoudhary/.appcelerator/install/7.0.9/package/node_modules/titanium/node_modules/async/dist/async.js:1034:9
    at eachOfLimit (/Users/lchoudhary/.appcelerator/install/7.0.9/package/node_modules/titanium/node_modules/async/dist/async.js:1061:22)
    at /Users/lchoudhary/.appcelerator/install/7.0.9/package/node_modules/titanium/node_modules/async/dist/async.js:1066:16 code: 'ESRCH', errno: 'ESRCH', syscall: 'kill' }
[LiveView] Error closing server { Error: kill ESRCH
    at Object._errnoException (util.js:1024:11)
    at process.kill (internal/process.js:183:18)
    at /Users/lchoudhary/Library/Application Support/Titanium/mobilesdk/osx/8.0.0.v20190114044343/node_modules/liveview/lib/fserver.js:103:12
    at Array.forEach (<anonymous>)
    at Object.FServer.stop (/Users/lchoudhary/Library/Application Support/Titanium/mobilesdk/osx/8.0.0.v20190114044343/node_modules/liveview/lib/fserver.js:98:7)
    at Timeout.<anonymous> (/Users/lchoudhary/Library/Application Support/Titanium/mobilesdk/osx/8.0.0.v20190114044343/node_modules/liveview/lib/fserver.js:354:13)
    at ontimeout (timers.js:475:11)
    at tryOnTimeout (timers.js:310:5)
    at Timer.listOnTimeout (timers.js:270:5)
---------------------------------------------
    at Socket.<anonymous> (/Users/lchoudhary/Library/Application Support/Titanium/mobilesdk/osx/8.0.0.v20190114044343/node_modules/liveview/lib/fserver.js:353:20)
    at emitNone (events.js:111:20)
    at Socket.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1056:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickDomainCallback (internal/process/next_tick.js:218:9)
---------------------------------------------
    at Socket.Readable.on (_stream_readable.js:772:35)
    at Server.<anonymous> (/Users/lchoudhary/Library/Application Support/Titanium/mobilesdk/osx/8.0.0.v20190114044343/node_modules/liveview/lib/fserver.js:348:10)
    at emitOne (events.js:116:13)
    at Server.emit (events.js:211:7)
    at TCP.onconnection (net.js:1561:8)
---------------------------------------------
    at Object.FServer.start (/Users/lchoudhary/Library/Application Support/Titanium/mobilesdk/osx/8.0.0.v20190114044343/node_modules/liveview/lib/fserver.js:341:12)
    at startServer (/Users/lchoudhary/Library/Application Support/Titanium/mobilesdk/osx/8.0.0.v20190114044343/node_modules/liveview/hook/lvhook.js:225:11)
    at ClientRequest.<anonymous> (/Users/lchoudhary/Library/Application Support/Titanium/mobilesdk/osx/8.0.0.v20190114044343/node_modules/liveview/hook/lvhook.js:182:6)
    at emitNone (events.js:106:13)
    at ClientRequest.emit (events.js:208:7)
    at Socket.socketCloseListener (_http_client.js:350:7)
    at emitOne (events.js:121:20)
---------------------------------------------
    at Domain.<anonymous> (/Users/lchoudhary/Library/Application Support/Titanium/mobilesdk/osx/8.0.0.v20190114044343/node_modules/liveview/hook/lvhook.js:181:6)
    at Domain.run (domain.js:242:14)
    at /Users/lchoudhary/Library/Application Support/Titanium/mobilesdk/osx/8.0.0.v20190114044343/node_modules/liveview/hook/lvhook.js:176:10
    at /Users/lchoudhary/.appcelerator/install/7.0.9/package/node_modules/titanium/lib/hook.js:235:13
    at /Users/lchoudhary/.appcelerator/install/7.0.9/package/node_modules/titanium/node_modules/async/dist/async.js:3845:9
    at replenish (/Users/lchoudhary/.appcelerator/install/7.0.9/package/node_modules/titanium/node_modules/async/dist/async.js:1030:17)
    at /Users/lchoudhary/.appcelerator/install/7.0.9/package/node_modules/titanium/node_modules/async/dist/async.js:1034:9
    at eachOfLimit (/Users/lchoudhary/.appcelerator/install/7.0.9/package/node_modules/titanium/node_modules/async/dist/async.js:1061:22)
    at /Users/lchoudhary/.appcelerator/install/7.0.9/package/node_modules/titanium/node_modules/async/dist/async.js:1066:16 code: 'ESRCH', errno: 'ESRCH', syscall: 'kill' }

Comments

  1. Ewan Harris 2019-01-14

    So there's a change to autokill the liveview server if it hasn't reloaded in 10 seconds (https://github.com/appcelerator/liveview/pull/119). In hindsight that's way too short, 1 minute is probably a sane minimum. https://github.com/appcelerator/liveview/blob/1c8d3ba0539cb7765bbd46ab07e0ebad1c2216a9/lib/fserver.js#L355 just needs changing to a new number.
  2. Ewan Harris 2019-01-14

    https://github.com/appcelerator/liveview/pull/123
  3. Jason Kneen 2019-01-14

    Oops. My bad.
  4. Lokesh Choudhary 2019-01-14

    [~eharris], I think a minute is short as well. I guess 3-5 minutes should be good. Because I think it will defeat the purpose of liveview if we have to rebuild the app again after a minute timeout interval to see the changes. Don't know I might be wrong here. What do you think ?
  5. Gary Mathews 2019-01-18

    master: https://github.com/appcelerator/titanium_mobile/pull/10635 8_0_X: https://github.com/appcelerator/titanium_mobile/pull/10636
  6. Ewan Harris 2019-01-21

    master liveview update: https://github.com/appcelerator/titanium_mobile/pull/10633 8_0_X liveview update: https://github.com/appcelerator/titanium_mobile/pull/10639
  7. Lokesh Choudhary 2019-01-23

    Latest PR's merged.
  8. Lokesh Choudhary 2019-01-23

    Verified the fix with sdk 8.0.0.v20190123061938. Closing. Studio Ver: 5.1.2.201812191831 SDK Ver: 8.0.0.v20190123061938 OS Ver: 10.14 Xcode Ver: Xcode 10.1 Appc NPM: 4.2.13 Appc CLI: 7.0.10-master.5 Daemon Ver: 1.1.3 Ti CLI Ver: 5.1.1 Alloy Ver: 1.13.7 Node Ver: 8.9.1 NPM Ver: 5.5.1 Java Ver: 10.0.2 Devices: ⇨ google Nexus 5 (Android 6.0.1) ⇨ google Pixel (Android 9)

JSON Source