[db023/Replication] App suddenly stops and exits without warning


still cruising on
SGW 2.00 Beta2 (823)
CBL 2 beta (db023)
CBS 5.5

So, we are in the middle of sequential replication where we start one replication after the other is done. This works very well for very small buckets but it crashes after a couple of replication.

It just returns to the android homescreen in the middle of a replication without any form of error or other notice.

The logcat gives me:

03-22 09:12:34.599: I/[Replication:search](14582): SEARCH (False/PushAndPull) changed: 54/500 status:Busy					
03-22 09:12:35.216: I/[Replication:search](14582): SEARCH (False/PushAndPull) changed: 55/500 status:Busy					
03-22 09:12:35.320: I/[Replication:search](14582): SEARCH (False/PushAndPull) changed: 158/500 status:Busy					
03-22 09:12:36.966: I/WindowState(556): WIN DEATH: Window{308d2a83 u0 com.mobile.xxxxxxxxxxxxx.xxxxxxxxxxxxxandroid/md5833b50a1e1772477f5c624e1ed573028.MainActivity}				
03-22 09:12:36.968: W/InputDispatcher(556): channel 'adc6f2e com.mobile.xxxxxxxxxxxxx.xxxxxxxxxxxxxandroid/md5833b50a1e1772477f5c624e1ed573028.MainActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9					
03-22 09:12:36.968: E/InputDispatcher(556): channel 'adc6f2e com.mobile.xxxxxxxxxxxxx.xxxxxxxxxxxxxandroid/md5833b50a1e1772477f5c624e1ed573028.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!					
03-22 09:12:36.974: I/WindowState(556): WIN DEATH: Window{adc6f2e u0 com.mobile.xxxxxxxxxxxxx.xxxxxxxxxxxxxandroid/md5833b50a1e1772477f5c624e1ed573028.MainActivity}				
03-22 09:12:36.974: W/InputDispatcher(556): Attempted to unregister already unregistered input channel 'adc6f2e com.mobile.xxxxxxxxxxxxx.xxxxxxxxxxxxxandroid/md5833b50a1e1772477f5c624e1ed573028.MainActivity (server)'					
03-22 09:12:36.981: W/SurfaceFlinger(174): couldn't log to binary event log: overflow.					
03-22 09:12:37.029: I/Zygote(199): Process 14582 exited due to signal (11)					
03-22 09:12:37.068: I/ActivityManager(556): Process com.mobile.xxxxxxxxxxxxx.xxxxxxxxxxxxxandroid (pid 14582) has died					
03-22 09:12:37.069: W/ActivityManager(556): Force removing ActivityRecord{22f82ffc u0 com.mobile.xxxxxxxxxxxxx.xxxxxxxxxxxxxandroid/md5833b50a1e1772477f5c624e1ed573028.MainActivity t15595}: app died, no saved state					
03-22 09:12:37.163: W/SurfaceFlinger(174): couldn't log to binary event log: overflow.					
03-22 09:12:37.237: D/AndroidRuntime(15754): >>>>>> START com.android.internal.os.RuntimeInit uid 2000 <<<<<<		

The Sync Gateway Log gives

2018-03-22T09:13:05.754+01:00 SyncMsg: [191ea519] #002: Type:subChanges Since:432 BatchSize:500  User:xxx				
2018-03-22T09:13:05.754+01:00 Sync: [191ea519] Sending changes since 432. User:xxx				
2018-03-22T09:13:05.754+01:00 Changes+: Int sequence multi changes feed...				
2018-03-22T09:13:05.755+01:00 Changes: MultiChangesFeed(channels: {*}, options: {Since:432 Limit:0 Conflicts:false IncludeDocs:false Wait:false Continuous:false Terminator:0xc046b38120 HeartbeatMs:0 TimeoutMs:0 ActiveOnly:false}) ...   (to xxx)				
2018-03-22T09:13:05.755+01:00 Changes+: MultiChangesFeed: channels expand to "!:1,*:5" ...   (to xxx)				
2018-03-22T09:13:05.755+01:00 Cache: getCachedChanges("!", 432) --> 0 changes valid from #1				
2018-03-22T09:13:05.755+01:00 Changes+: [changesFeed] Found 0 changes for channel !				
2018-03-22T09:13:05.755+01:00 Changes+: [changesFeed] Found 0 changes for channel *				
2018-03-22T09:13:05.755+01:00 Changes: MultiChangesFeed done   (to xxx)				
2018-03-22T09:13:05.755+01:00 Sync+: [191ea519]     Sending 0 changes. User:xxx				
2018-03-22T09:13:05.755+01:00 Sync: [191ea519] Sent all changes to client. User:xxx				
2018-03-22T09:13:05.755+01:00 SyncMsg+: [191ea519] #002: Type:subChanges   --> Time:994.6µs User:xxx 				
2018-03-22T09:13:05.778+01:00 HTTP+: [357be8f8] #022:    --> BLIP+WebSocket connection closed				
2018-03-22T09:13:05.779+01:00 SyncMsg: [191ea519] #003: Type:proposeChanges #Changes: 0 User:xxx				
2018-03-22T09:13:05.779+01:00 SyncMsg+: [191ea519] #003: Type:proposeChanges   --> OK Time:0s User:xxx 				
2018-03-22T09:13:05.891+01:00 HTTP+: [39a2ffba] #027:    --> BLIP+WebSocket connection closed				
2018-03-22T09:13:05.973+01:00 HTTP+: [191ea519] #023:    --> BLIP+WebSocket connection closed				
2018-03-22T09:13:06.013+01:00 HTTP+: [12c4713f] #028:    --> BLIP+WebSocket connection closed				
2018-03-22T09:13:06.051+01:00 HTTP+: [7850c56b] #026:    --> BLIP+WebSocket connection closed				

I think it has something to do with:

Consumer closed input channel or an error occurred. 
Channel is unrecoverably broken and will be disposed!	

It has something to do with too much threads

  1. Basically this Errors occurs couple of times if your running number of process at a time in single thread . This is like a Deadlock situation.So any Scheduled tasks are there make it Synchronized particular burden objects. 2) Kill the unused processes at the time of Burden happens on MainThread.

I’ve filed the issue (996) and build from the current master branch. But the problem still persists

update: I’ve added this to the mentioned closed issue as well

None of those Android logs seem to have any relation to Couchbase Lite. I don’t know what an “input channel” is, but it sounds like it has something to do with user input. The most relevant answer from Stack Overflow looks like:

That error shows up after an app crashed (or was force-stopped). The part in Android that forwards input events (touchscreen presses etc) to your app has noticed that it’s target is no longer there. Look for an error that happens before that one.