Skip to content
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

DC_EVENT_CONNECTIVITY_CHANGED fired constantly while offline #4847

Closed
adbenitez opened this issue Oct 22, 2023 · 1 comment
Closed

DC_EVENT_CONNECTIVITY_CHANGED fired constantly while offline #4847

adbenitez opened this issue Oct 22, 2023 · 1 comment
Assignees
Labels
bug Something is not working

Comments

@adbenitez
Copy link
Member

recently @hpk42 reported this issue:
in Delta Chat Android:
go offline, kill delta chat app and open again, or open connectivity screen and close it, then:
open connectivity view (tapping the app title in the title bar)
the app will get slow / frozen

the DC_EVENT_CONNECTIVITY_CHANGED event is fired constantly and the app tries to refresh the connectivity HTML page constantly, looking at the logs, IMAP job is constantly trying to reconnect,

INTERESTING: notice that if you are online, go offline, and open the connectivity view, it doesn't always happen, it will happen then the second time you try to open connectivity view, or if you kill the app and start the app being offline from the start

NOTE: maybeNetwork() is not being called by the Android app (the calls to maybe network are logged and as you can see they don't appear in the logs while you are offline, maybeNetwork() is called when DcHelper.isNetworkConnected() returns true and that is false while offline, also startIo() is not spammed)

Logs when the Connectivity view is opened the first time and the infinite re-connection doesn't happen:

10-22 15:51:33.017 21739 21770 I DeltaChat: src/imap/idle.rs:207: Fake IDLE interrupted                                                                                                                                                     
10-22 15:51:33.017 21739 21770 I DeltaChat: src/imap/idle.rs:213: IMAP-fake-IDLE done after 3.9520s                                                                                                                                         
10-22 15:51:33.017 21739 21770 I DeltaChat: src/job.rs:264: Loading job.                                                                                                                                                                    
10-22 15:51:33.017 21739 21770 I DeltaChat: src/imap.rs:309: Connecting to IMAP server                                                                                                                                                      
10-22 15:51:33.020 21739 21770 W DeltaChat: src/net.rs:55: DNS resolution for box.hispanilandia.net:993 failed: DNS lookup failure: failed to lookup address information: No address associated with hostname.                              
10-22 15:51:33.020 21739 21770 W DeltaChat: src/net.rs:169: Failed to connect to 51.15.127.36:993: connection failure: Network is unreachable (os error 101).                                                                               
10-22 15:51:33.021 21739 21770 W DeltaChat: src/net.rs:169: Failed to connect to 100.108.15.165:993: connection failure: Network is unreachable (os error 101).                                                                             
10-22 15:51:33.021 21739 21770 W DeltaChat: src/quota.rs:137: could not connect: connection failure: Network is unreachable (os error 101)                                                                                                  
10-22 15:51:33.021 21739 21770 I DeltaChat: src/imap.rs:309: Connecting to IMAP server                                                                                                                                                      
10-22 15:51:33.024 21739 21770 W DeltaChat: src/net.rs:55: DNS resolution for box.hispanilandia.net:993 failed: DNS lookup failure: failed to lookup address information: No address associated with hostname.                              
10-22 15:51:33.024 21739 21770 W DeltaChat: src/net.rs:169: Failed to connect to 51.15.127.36:993: connection failure: Network is unreachable (os error 101).                                                                               
10-22 15:51:33.024 21739 21770 W DeltaChat: src/net.rs:169: Failed to connect to 100.108.15.165:993: connection failure: Network is unreachable (os error 101).                                                                             
10-22 15:51:33.024 21739 21770 W DeltaChat: src/scheduler.rs:481: prepare IMAP connection: connection failure: Network is unreachable (os error 101)                                                                                        
10-22 15:51:33.024 21739 21770 I DeltaChat: src/imap.rs:450: Dropping an IMAP connection.                                                                                                                                                   
10-22 15:51:33.024 21739 21770 I DeltaChat: src/imap/idle.rs:140: IMAP-fake-IDLEing folder="INBOX"                                                                                                                                          
10-22 15:51:33.024 21739 21770 I DeltaChat: src/imap.rs:309: Connecting to IMAP server                                                                                                                                                      
10-22 15:51:33.026 21739 21770 W DeltaChat: src/net.rs:55: DNS resolution for box.hispanilandia.net:993 failed: DNS lookup failure: failed to lookup address information: No address associated with hostname.                              
10-22 15:51:33.027 21739 21770 W DeltaChat: src/net.rs:169: Failed to connect to 51.15.127.36:993: connection failure: Network is unreachable (os error 101).                                                                               
10-22 15:51:33.027 21739 21770 W DeltaChat: src/net.rs:169: Failed to connect to 100.108.15.165:993: connection failure: Network is unreachable (os error 101).                                                                             
10-22 15:51:33.027 21739 21770 W DeltaChat: src/imap/idle.rs:168: fake_idle: could not connect: connection failure

Logs when the Infinite "connectivity changed" event are triggered opening the Connectivity view a second time:

10-22 15:51:42.125 21739 21770 I DeltaChat: src/imap/idle.rs:207: Fake IDLE interrupted                                                                                                                                           [477/1986]
10-22 15:51:42.125 21739 21770 I DeltaChat: src/imap/idle.rs:213: IMAP-fake-IDLE done after 9.1010s                                                                                                                                         
10-22 15:51:42.125 21739 21770 I DeltaChat: src/job.rs:264: Loading job.                                                                                                                                                                    
10-22 15:51:42.125 21739 21770 I DeltaChat: src/imap.rs:309: Connecting to IMAP server                                                                                                                                                      
10-22 15:51:42.128 21739 21770 W DeltaChat: src/net.rs:55: DNS resolution for box.hispanilandia.net:993 failed: DNS lookup failure: failed to lookup address information: No address associated with hostname.                              
10-22 15:51:42.128 21739 21770 W DeltaChat: src/net.rs:169: Failed to connect to 51.15.127.36:993: connection failure: Network is unreachable (os error 101).                                                                               
10-22 15:51:42.130 21739 21770 W DeltaChat: src/net.rs:169: Failed to connect to 100.108.15.165:993: connection failure: Network is unreachable (os error 101).                                                                             
10-22 15:51:42.130 21739 21770 W DeltaChat: src/quota.rs:137: could not connect: connection failure: Network is unreachable (os error 101)                                                                                                  
10-22 15:51:42.130 21739 21770 I DeltaChat: src/imap.rs:309: Connecting to IMAP server                                                                                                                                                      
10-22 15:51:42.130 21739 21770 W DeltaChat: src/net.rs:55: DNS resolution for box.hispanilandia.net:993 failed: DNS lookup failure: failed to lookup address information: No address associated with hostname.                              
10-22 15:51:42.131 21739 21770 W DeltaChat: src/net.rs:169: Failed to connect to 51.15.127.36:993: connection failure: Network is unreachable (os error 101).                                                                               
10-22 15:51:42.131 21739 21770 W DeltaChat: src/net.rs:169: Failed to connect to 100.108.15.165:993: connection failure: Network is unreachable (os error 101).                                                                             
10-22 15:51:42.131 21739 21770 W DeltaChat: src/scheduler.rs:481: prepare IMAP connection: connection failure: Network is unreachable (os error 101)                                                                                        
10-22 15:51:42.131 21739 21770 I DeltaChat: src/imap.rs:450: Dropping an IMAP connection.                                                                                                                                                   
10-22 15:51:42.131 21739 21770 I DeltaChat: src/imap/idle.rs:140: IMAP-fake-IDLEing folder="INBOX"                                                                                                                                          
10-22 15:51:42.132 21739 21770 I DeltaChat: src/imap.rs:309: Connecting to IMAP server
10-22 15:51:42.136 21739 21770 W DeltaChat: src/net.rs:55: DNS resolution for box.hispanilandia.net:993 failed: DNS lookup failure: failed to lookup address information: No address associated with hostname.
10-22 15:51:42.137 21739 21770 W DeltaChat: src/net.rs:169: Failed to connect to 51.15.127.36:993: connection failure: Network is unreachable (os error 101).
10-22 15:51:42.137 21739 21770 W DeltaChat: src/net.rs:169: Failed to connect to 100.108.15.165:993: connection failure: Network is unreachable (os error 101).
10-22 15:51:42.137 21739 21770 W DeltaChat: src/imap/idle.rs:168: fake_idle: could not connect: connection failure
10-22 15:51:42.174 21739 21770 I DeltaChat: src/imap/idle.rs:207: Fake IDLE interrupted
10-22 15:51:42.174 21739 21770 I DeltaChat: src/imap/idle.rs:213: IMAP-fake-IDLE done after 0.0420s
10-22 15:51:42.174 21739 21770 I DeltaChat: src/job.rs:264: Loading job.
10-22 15:51:42.174 21739 21770 I DeltaChat: src/imap.rs:309: Connecting to IMAP server
10-22 15:51:42.177 21739 21770 W DeltaChat: src/net.rs:55: DNS resolution for box.hispanilandia.net:993 failed: DNS lookup failure: failed to lookup address information: No address associated with hostname.
10-22 15:51:42.177 21739 21770 W DeltaChat: src/net.rs:169: Failed to connect to 51.15.127.36:993: connection failure: Network is unreachable (os error 101).
10-22 15:51:42.177 21739 21770 W DeltaChat: src/net.rs:169: Failed to connect to 100.108.15.165:993: connection failure: Network is unreachable (os error 101).
10-22 15:51:42.177 21739 21770 W DeltaChat: src/quota.rs:137: could not connect: connection failure: Network is unreachable (os error 101)
10-22 15:51:42.177 21739 21770 I DeltaChat: src/imap.rs:309: Connecting to IMAP server
10-22 15:51:42.179 21739 21770 W DeltaChat: src/net.rs:55: DNS resolution for box.hispanilandia.net:993 failed: DNS lookup failure: failed to lookup address information: No address associated with hostname.
10-22 15:51:42.180 21739 21770 W DeltaChat: src/net.rs:169: Failed to connect to 51.15.127.36:993: connection failure: Network is unreachable (os error 101).
10-22 15:51:42.181 21739 21770 W DeltaChat: src/net.rs:169: Failed to connect to 100.108.15.165:993: connection failure: Network is unreachable (os error 101).
10-22 15:51:42.181 21739 21770 W DeltaChat: src/scheduler.rs:481: prepare IMAP connection: connection failure: Network is unreachable (os error 101)
10-22 15:51:42.181 21739 21770 I DeltaChat: src/imap.rs:450: Dropping an IMAP connection.
10-22 15:51:42.181 21739 21770 I DeltaChat: src/imap/idle.rs:140: IMAP-fake-IDLEing folder="INBOX"
10-22 15:51:42.181 21739 21770 I DeltaChat: src/imap/idle.rs:207: Fake IDLE interrupted
10-22 15:51:42.181 21739 21770 I DeltaChat: src/imap/idle.rs:213: IMAP-fake-IDLE done after 0.0000s
10-22 15:51:42.182 21739 21770 I DeltaChat: src/job.rs:264: Loading job.
10-22 15:51:42.182 21739 21770 I DeltaChat: src/imap.rs:309: Connecting to IMAP server
10-22 15:51:42.183 21739 21770 W DeltaChat: src/net.rs:55: DNS resolution for box.hispanilandia.net:993 failed: DNS lookup failure: failed to lookup address information: No address associated with hostname.
10-22 15:51:42.185 21739 21770 W DeltaChat: src/net.rs:169: Failed to connect to 51.15.127.36:993: connection failure: Network is unreachable (os error 101).
10-22 15:51:42.185 21739 21770 W DeltaChat: src/net.rs:169: Failed to connect to 100.108.15.165:993: connection failure: Network is unreachable (os error 101).
10-22 15:51:42.186 21739 21770 W DeltaChat: src/quota.rs:137: could not connect: connection failure: Network is unreachable (os error 101)
10-22 15:51:42.186 21739 21770 I DeltaChat: src/imap.rs:309: Connecting to IMAP server
10-22 15:51:42.188 21739 21770 W DeltaChat: src/net.rs:55: DNS resolution for box.hispanilandia.net:993 failed: DNS lookup failure: failed to lookup address information: No address associated with hostname.
10-22 15:51:42.189 21739 21770 W DeltaChat: src/net.rs:169: Failed to connect to 51.15.127.36:993: connection failure: Network is unreachable (os error 101).
10-22 15:51:42.190 21739 21770 W DeltaChat: src/net.rs:169: Failed to connect to 100.108.15.165:993: connection failure: Network is unreachable (os error 101).
10-22 15:51:42.190 21739 21770 W DeltaChat: src/scheduler.rs:481: prepare IMAP connection: connection failure: Network is unreachable (os error 101)
10-22 15:51:42.190 21739 21770 I DeltaChat: src/imap.rs:450: Dropping an IMAP connection.
10-22 15:51:42.190 21739 21770 I DeltaChat: src/imap/idle.rs:140: IMAP-fake-IDLEing folder="INBOX"
10-22 15:51:42.190 21739 21770 I DeltaChat: src/imap/idle.rs:207: Fake IDLE interrupted
10-22 15:51:42.190 21739 21770 I DeltaChat: src/imap/idle.rs:213: IMAP-fake-IDLE done after 0.0000s
[...]
@adbenitez adbenitez added the bug Something is not working label Oct 22, 2023
@link2xt
Copy link
Collaborator

link2xt commented Oct 22, 2023

The issue is likely caused by #4804 (EDIT: not really, because it only sets status to connected, never to "not connected", the bug must have existed even before)

But the fix would be to stop get_connectivity_html triggering updates via schedule_quota_update when current status is not_connected. In fact, get_connectivity_html should not ever trigger any updates, if you want latest data call maybe_network or we should make a separate "update quota" function.

Minimal fix would be to remove this line:

self.schedule_quota_update().await?;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working
Projects
None yet
Development

No branches or pull requests

2 participants