-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stuck Threads when creating a continous replication #80
Comments
Can you provide the link to the code? Line 1787 on release/1.4.0 branch might not point to correct line. |
Sorry for writing the wrong line number, it has to be 1878 in the Router class. I downloaded the source from maven with the netbeans download source button. I also added a test project which shows the stuck threads: https://github.com/traugott/CouchbaseLiteListenerTest Short snippet around 1878:
` |
@traugott, |
right, /_changes is a longpoll. But if the client disconnects, the thread in the thread pool stays in busy state. After the threads in the thread pool are all busy (20 threads is the default), no more new replications occur. I agree if the client stays connected, but not if the client gets closed. |
I guess that Listener side sockets can not detect the disconnection when a client closes a connection or the network error occurs. Then Listener side threads are kept blocked. But the client resends the new requests. As result, all threads at Listener side are blocked. Can you capture Http requests between client and listener? By the way, How many client devices are you using for your tests? |
The listener runs on an android device. The Replicators run on an android device or on linux. In my tests i only use the android device with the listener and one client on my linux machine. As mentioned earlier, i added a test project, available at This is simple and runnable under linux. It starts two managers the the listener/replicators. It shows the same effect (stuck threads). At the moment i have no infrastructure for capturing the http requests. Would you prefer wireshark ? I only can capture the http requests on the linux side. |
We have tested Android to Android. Under the regular condition, we have confirmed this architecture works.
|
At the moment i was only able to connect from a windows machine to the android device. The Listener port on the android device is 5177. The Android device has the ip 192.168.43.1, the windows machine 192.168.43.73 I recorded the communication between the android device and the windows machine. The netstat command was called after the client on the windows machine gets closed. Because my android device is not rooted, i used the adm tool to get a thread dump and copied it via clipboard to a text file. I copied the thread dump after the client disconnects All three things i zipped and attached. By the way, the same problem is shown on File: couchbaselite.zip |
2)App UI JS/HTML make REST request using modules.js
Please confirm.. Problem: Suddenly we see none of the request reaching the Listener. We get xhr.statusCode == 0 for all XMLHttpRequest requests. https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/status Why we get from webview xhr.statusCode == 0 |
@NitzDKoder |
@hideki app sends
How does the LTE network up/down effect local scoket created? Ex: Where is LTE up down involved.? Thanks |
Hi @NitzDKoder
Replicator does not connect to Listener. This should not affect to the Listener
I believe this indicates Application's JavaScript sends So LTE up and down should not cause the problem that you are observing. Do you see LTE up and down affect local to local communication? If not, the problem is somewhere else. |
Stop Sync = {"target":"ptxdata","source":{"url":"https://AAAAAAAAAAAA:XXXXXXXXXXXXXXXXX@mydomain/data"},"continuous":true,"filter":"sync_gateway/bychannel","query_params":{"channels":"PTX-919480109390-meta-CH,919480109390-CH"}}
Line 2050: [08/28 17:54:22:685] [HTML5LOG] ReSTCBL ::: Request started::{"id":"142: GET https://:@localdomain:14480/data/_changes?since=97&include_docs=true&style=main_only&heartbeat=300000&feed=longpoll"}
Line 2553: History url = https://:@localdomain:14480/data/_design%2FgetHistory/_view/getHistory?key=%22tel%3A%2B919663733552%22&reduce=false&group=false All the request fail sometimes on network tranistions.
Workaround: TODO: Will update more.. Thanks |
I have multiple android devices. One device creates an LiteListener listener where the other devices replicates to. The other devices uses continous replication.
In the class com.couchbase.lite.router.Router in line 1787 (version 1.4.0 from maven repo) the Status is set to zero. In this case the Method
com.couchbase.lite.router.Router.start doesnt call sendResponse(), so the callback block doesnt get called.
The callback block is defined in com.couchbase.lite.listener.LiteServlet. The callback block counts down the doneSignal. Only if this doneSignal is counted down, the
thread gets put back in the threadpool.
The Acme threadpool runs out of threads and no replication occurs any more.
MODIFIED: The callback also doesnt get called when the jvm which replicates terminates
The text was updated successfully, but these errors were encountered: