`firebase_admin.db.reference` leaks connections in a `CLOSE_WAIT` state
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện vấn đề với một máy chủ websocket Python, tạo một firebase_admin.db.reference và gọi set trong trình xử lý kết nối. Sử dụng netstat sau khi các kết nối kết thúc để kiểm tra các socket CLOSE_WAIT. Hoàn tất khi vòng đời của kết nối reference được giải thích và tình trạng tích tụ được báo cáo đã được giải quyết hoặc hành vi teardown cần thiết đã được ghi lại.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Step 2: Describe your environment
- Operating System version: OS X Ventura 13.4
- Firebase SDK version: 6.2.0
- Firebase Product: database
- Python version: 3.11.2
- Pip version: 23.1.2
Step 3: Describe the problem
I have a Python websocket application that creates a reference to RTDB via firebase_admin.db.reference, and writes to it via the set method. I create one reference per connection to my database. It appears that this reference does not necessarily get cleaned up, as I've noticed in my server that connections with a CLOSE_WAIT state are aggregating specifically with this RTDB update. More concerning is that the application appears to be receiving bytes of data at a consistent rate from this connection despite it being in a CLOSE_WAIT state.
What is the proper way to tear down a reference once I know I'm done with it? It seems like this is a bug from the firebase_admin python package as there don't be any instructions or indication that we need to tear down the reference.
Steps to reproduce:
- Create a Python websocket server with the
websocketslibrary - Within the connection handler, instantiate a reference via
firebase_admin.db.referenceand write a value - Approximately 1 minute after the connection terminates, use
netstatto observe that the connection still exists in aCLOSE_WAITstate and that the application is receiving data from it.
Here's my netstat output
root@474683837e04:/app# netstat -ntuap
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.11:38913 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 1/python
tcp 25 0 172.24.0.3:34160 34.120.160.131:443 CLOSE_WAIT 1/python
tcp 1 0 172.24.0.3:58576 142.250.191.74:443 CLOSE_WAIT 1/python
tcp6 0 0 :::8080 :::* LISTEN 1/python
udp 0 0 127.0.0.11:54888 0.0.0.0:* -
Using connections with all of the reference related code commented out and then netstat'ing after shows that this issue does not appeare.
- Ngôn ngữ chính
- Python
- Star
- 1.2k
- Fork
- 359
- Merge trung bình
- 5 ngày 6 phút
- Pull request đã merge (30 ngày)
- 2
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của firebase/firebase-admin-python
-
api: remoteconfig
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
firebase/firebase-admin-python#957 · 1 bình luận ·
-
api: database type: feature request
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
firebase/firebase-admin-python#978 · 1 bình luận ·
-
[FR] Support VERIFY_AND_CHANGE_EMAIL in generate_email_action_link (parity with firebase-admin-node) Đang mởapi: auth
firebase/firebase-admin-python#949 · 2 bình luận · 1 reaction · 1 người được giao ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 43/100
firebase/firebase-admin-python#945 · 1 bình luận · 1 reaction ·
Tất cả issue của firebase/firebase-admin-python
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
learningequality/ricecooker#747 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
BSData/horus-heresy-3rd-edition#3171 ·
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
run-llama/llama_index#23199 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
KhronosGroup/glTF-Blender-IO#2769 ·