Description
When the internet disconnects, the Firebase Realtime Database listener crashes, even with try and except statements. The application fails to recover and reconnect the listeners, resulting in the following error:
javascript
Code kopieren
google.api_core.exceptions.RetryError: Deadline of 120.0s exceeded while calling target function, last exception: HTTPSConnectionPool(host='storage.googleapis.com', port=443): Max retries exceeded with url: /storage/v1/b/villaduniatest.appspot.com/o?projection=noAcl&prefix=pdfstable%2F&prettyPrint=false (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000017C6BBE79D0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))
Reconnecting...
Steps to Reproduce
Start a Firebase Realtime Database listener in a Python application.
Disconnect the internet.
Observe the application crash with the above error.
Expected Behavior
The application should handle the disconnection gracefully, retrying the connection until the internet is restored, without crashing.
Actual Behavior
The application crashes immediately upon internet disconnection, and does not recover.
Environment
Firebase Admin SDK: Python
Python Version: (your Python version)
Operating System: (your OS version)
Additional Context
Here is the relevant portion of the code:
python
Code kopieren
import firebase_admin
from firebase_admin import credentials, initialize_app, db
from requests.exceptions import ConnectionError, Timeout
import time
Description When the internet disconnects, the Firebase Realtime Database listener crashes, even with try and except statements. The application fails to recover and reconnect the listeners, resulting in the following error:
javascript Code kopieren google.api_core.exceptions.RetryError: Deadline of 120.0s exceeded while calling target function, last exception: HTTPSConnectionPool(host='storage.googleapis.com', port=443): Max retries exceeded with url: /storage/v1/b/villaduniatest.appspot.com/o?projection=noAcl&prefix=pdfstable%2F&prettyPrint=false (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000017C6BBE79D0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')) Reconnecting... Steps to Reproduce Start a Firebase Realtime Database listener in a Python application. Disconnect the internet. Observe the application crash with the above error. Expected Behavior The application should handle the disconnection gracefully, retrying the connection until the internet is restored, without crashing.
Actual Behavior The application crashes immediately upon internet disconnection, and does not recover.
Environment Firebase Admin SDK: Python Python Version: (your Python version) Operating System: (your OS version) Additional Context Here is the relevant portion of the code:
python Code kopieren import firebase_admin from firebase_admin import credentials, initialize_app, db from requests.exceptions import ConnectionError, Timeout import time
class DatabaseListener: def init(self, app_instance): self.app_instance = app_instance self.listeners = {}
Any guidance or solutions to ensure the listener can recover from network disconnections would be greatly appreciated