openimsdk / openim-sdk-core

Instant Messaging
https://openim.io
Apache License 2.0
348 stars 313 forks source link

Bug: Flutter plugin crash with `panic: close of closed channel` #372

Open shirne opened 11 months ago

shirne commented 11 months ago

What happened?

app crash on launch

I/GoLog   (32275): 2023-10-15 01:40:14.341  ERROR   [PID:32275] [util/post.go:56]   CallApi {"operationID": "1697334013108", "api": "/friend/get_self_friend_apply_list", "use": "state", "failed": 0.000169635, "error": "ApiPost http.Client.Do failed Post \"http://172.105.107.69:9005/friend/get_self_friend_apply_list\": context canceled: 10000 NetworkError"}
I/GoLog   (32275): 2023-10-15 01:40:14.342  ERROR   [PID:32275] [util/post.go:78]   ApiRequest  {"operationID": "1697334013108", "type": "network error", "error": "Post \"http://172.105.107.69:9005/group/get_recv_group_applicationList\": context canceled"}
I/GoLog   (32275): 2023-10-15 01:40:14.342  ERROR   [PID:32275] [util/post.go:56]   CallApi {"operationID": "1697334013108", "api": "/group/get_recv_group_applicationList", "use": "state", "failed": 0.000158958, "error": "ApiPost http.Client.Do failed Post \"http://172.105.107.69:9005/group/get_recv_group_applicationList\": context canceled: 10000 NetworkError"}
I/F-OpenIMSDK(native call flutter)(32275): { method:connectListener,  type:onConnecting }
I/GoLog   (32275): 2023-10-15 01:40:14.340  ERROR   [PID:32275] [util/post.go:56]   CallApi {"operationID": "1697334013108", "api": "/user/get_users_info", "use": "state", "failed": 0.000139063, "error": "ApiPost http.Client.Do failed Post \"http://172.105.107.69:9005/user/get_users_info\": context canceled: 10000 NetworkError"}
I/GoLog   (32275): 2023-10-15 01:40:14.343  ERROR   [PID:32275] [util/post.go:78]   ApiRequest  {"operationID": "1697334013108", "type": "network error", "error": "Post \"http://172.105.107.69:9005/group/get_user_req_group_applicationList\": context canceled"}
I/GoLog   (32275): 2023-10-15 01:40:14.343  ERROR   [PID:32275] [util/post.go:78]   ApiRequest  {"operationID": "1697334013110", "type": "network error", "error": "Post \"http://172.105.107.69:9005/group/get_user_req_group_applicationList\": context canceled"}
I/GoLog   (32275): 2023-10-15 01:40:14.343  ERROR   [PID:32275] [util/post.go:56]   CallApi {"operationID": "1697334013110", "api": "/group/get_user_req_group_applicationList", "use": "state", "failed": 0.002911146, "error": "ApiPost http.Client.Do failed Post \"http://172.105.107.69:9005/group/get_user_req_group_applicationList\": context canceled: 10000 NetworkError"}
I/GoLog   (32275): 2023-10-15 01:40:14.343  ERROR   [PID:32275] [util/post.go:56]   CallApi {"operationID": "1697334013108", "api": "/group/get_user_req_group_applicationList", "use": "state", "failed": 0.000237343, "error": "ApiPost http.Client.Do failed Post \"http://172.105.107.69:9005/group/get_user_req_group_applicationList\": context canceled: 10000 NetworkError"}
I/GoLog   (32275): 2023-10-15 01:40:14.334  ERROR   [PID:32275] [util/post.go:78]   ApiRequest  {"operationID": "1697334013110", "type": "network error", "error": "Post \"http://172.105.107.69:9005/friend/get_friend_apply_list\": context canceled"}
I/GoLog   (32275): 2023-10-15 01:40:14.344  ERROR   [PID:32275] [util/post.go:56]   CallApi {"operationID": "1697334013110", "api": "/friend/get_friend_apply_list", "use": "state", "failed": 0.009506458, "error": "ApiPost http.Client.Do failed Post \"http://172.105.107.69:9005/friend/get_friend_apply_list\": context canceled: 10000 NetworkError"}
I/F-OpenIMSDK(native call flutter)(32275): { method:connectListener,  type:onConnectSuccess }
E/Go      (32275): panic: close of closed channel
E/Go      (32275):
E/Go      (32275): goroutine 293 [running]:
E/Go      (32275): open_im_sdk/internal/interaction.(*LongConnMgr).writePump.func1()
E/Go      (32275):  open_im_sdk@v0.0.0-00010101000000-000000000000/internal/interaction/long_conn_mgr.go:226 +0x30
E/Go      (32275): open_im_sdk/internal/interaction.(*LongConnMgr).writePump(0x40001d40c0, {0x7376c805e0, 0x4000090090})
E/Go      (32275):  open_im_sdk@v0.0.0-00010101000000-000000000000/internal/interaction/long_conn_mgr.go:232 +0x6b0
E/Go      (32275): created by open_im_sdk/internal/interaction.(*LongConnMgr).Run
E/Go      (32275):  open_im_sdk@v0.0.0-00010101000000-000000000000/internal/interaction/long_conn_mgr.go:119 +0x108

F/libc    (32275): Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 32540 (Thread-13), pid 32275 (ouds.tworoamers)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'xiaomi/whyred/whyred:9/PKQ1.180904.001/V12.0.3.0.PEICNXM:user/release-keys'
Revision: '0'
ABI: 'arm64'
pid: 32275, tid: 32540, name: Thread-13  >>> com.shyclouds.tworoamers <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
    x0  0000000000000000  x1  0000000000007f1c  x2  0000000000000006  x3  0000000000000008
    x4  0000000000000001  x5  0000000000000001  x6  0000000000000000  x7  000000000000000a
    x8  0000000000000083  x9  0000000000000061  x10 000000000007d3bb  x11 000000001cfdab82
    x12 0000000000000018  x13 00000000652b42ff  x14 002e7803f58c00a5  x15 0000a4d26ad4474a
    x16 000000734e546b98  x17 000000734e642040  x18 0000000000000008  x19 0000000000007e13
    x20 000000734e641ee0  x21 000000400005d000  x22 0000000000000001  x23 0000000000000000
    x24 00000073769ea220  x25 000000734e545000  x26 0000000000000000  x27 00000000000002f0
    x28 00000040000a7a00  x29 000000400009fbf8
    sp  000000400009fc00  lr  000000737626ca34  pc  0000007376288f48
backtrace:
    #00 pc 000000000023ef48  /data/app/com.shyclouds.tworoamers-6E-jHxsdKrltmfyru5ZcnA==/lib/arm64/libgojni.so

What did you expect to happen?

report direct error message

How can we reproduce it (as minimally and precisely as possible)?

can't reproduce

Anything else we need to know?

No response

version

```console flutter 3.13.7 flutter_openim_sdk 3.1.0 ```

Cloud provider

OS version

```console BuildNumber Caption OSArchitecture Version 19045 Microsoft Windows 10 专业版 64 位 10.0.19045 ```

Install tools

Checklist - [X] ``internal/util/post.go`` ✅ Commit 63a64f7 - [X] ``msgtest/module/manager.go`` ✅ Commit f8a3f3d - [X] ``pkg/network/http_client.go`` ✅ Commit 22dec58 - [X] ``internal/group/sync.go`` ✅ Commit 96ca38a - [X] ``test/account.go`` ✅ Commit 0675969
sweep-ai[bot] commented 11 months ago

Here's the PR! https://github.com/openimsdk/openim-sdk-core/pull/374.

⚡ Sweep Free Trial: I'm creating this ticket using GPT-4. You have 4 GPT-4 tickets left for the month and 2 for the day. For more GPT-4 tickets, visit our payment portal.

Actions (click)


Step 1: 🔎 Searching

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I looked at (click to expand). If some file is missing from here, you can mention the path in the ticket description. https://github.com/openimsdk/openim-sdk-core/blob/e85b55f943543648aaabd13143797267eb3d1dc6/internal/util/post.go#L1-L134 https://github.com/openimsdk/openim-sdk-core/blob/e85b55f943543648aaabd13143797267eb3d1dc6/msgtest/module/manager.go#L29-L113 https://github.com/openimsdk/openim-sdk-core/blob/e85b55f943543648aaabd13143797267eb3d1dc6/pkg/network/http_client.go#L29-L102 https://github.com/openimsdk/openim-sdk-core/blob/e85b55f943543648aaabd13143797267eb3d1dc6/internal/group/sync.go#L227-L281 https://github.com/openimsdk/openim-sdk-core/blob/e85b55f943543648aaabd13143797267eb3d1dc6/test/account.go#L131-L265
I also found the following external resources that might be helpful: **Summaries of links found in the content:** http://172.105.107.69:9005/group/get_user_req_group_applicationList: The page contains a crash log from an app. The log shows that the app crashed on launch and provides error messages related to network errors. The error messages indicate that there were issues with making API requests to various endpoints. The log also includes a panic error and a fatal signal error. The user expected to see a direct error message but did not receive any response. The page also includes information about the Flutter and Flutter OpenIM SDK versions, the cloud provider, and the OS version. There is no information about install tools. http://172.105.107.69:9005/user/get_users_info: The page contains a crash log from an app. The log shows that the app crashed on launch and provides error messages related to network errors. The error messages indicate that there were issues with making API requests to various endpoints. The log also includes a panic error and a fatal signal error. The user expected to see a direct error message but did not receive any response. The page also includes information about the Flutter and Flutter OpenIM SDK versions, the cloud provider, and the OS version. There is no information about install tools. http://172.105.107.69:9005/friend/get_self_friend_apply_list: The page contains a crash log from an app. The log shows that the app crashed on launch and provides error messages related to network errors. The error messages indicate that there were issues with making API requests to various endpoints. The log also includes a panic error and a fatal signal error. The user expected to see a direct error message but did not receive any response. The page also includes information about the Flutter and Flutter OpenIM SDK versions, as well as the OS version. There is no information about the cloud provider or install tools. http://172.105.107.69:9005/friend/get_friend_apply_list: The page contains a crash log from an app. The log shows that the app crashed on launch and provides error messages related to network errors. The error messages indicate that there were issues with making API requests to various endpoints. The log also includes a panic error and a fatal signal error. The user expected to see a direct error message but did not receive any response. The page also includes information about the Flutter and Flutter OpenIM SDK versions, the cloud provider, and the OS version. There is no information about install tools. http://172.105.107.69:9005/group/get_recv_group_applicationList: The page contains a crash log from an app. The log shows that the app crashed on launch and provides error messages related to network errors. The error messages indicate that there were issues with making API requests to various endpoints. The log also includes a panic error and a fatal signal error. The user expected to see a direct error message but did not receive any response. The page also includes information about the Flutter and Flutter OpenIM SDK versions, the cloud provider, and the OS version. There is no information about install tools.

Step 2: ⌨️ Coding


Step 3: 🔁 Code Review

I have finished reviewing the code for completeness. I did not find errors for sweep/fix-context-cancellation.

.


🎉 Latest improvements to Sweep:


💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request. Join Our Discord

FGadvancer commented 11 months ago

hi, you can provide more detail informations about this panic? like your app version and core version etc we can find the reason with your help.

shirne commented 11 months ago

flutter 3.13.7 flutter_openim_sdk 3.1.0

kubbot commented 11 months ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


flutter 3.13.7 flutter_openim_sdk 3.1.0

shirne commented 11 months ago

Flutter 3.13.8 flutter_openim_sdk 3.3.0 连接不稳定的时候还是会重现这个崩溃

[flutter_openim_sdk] ** Flutter Handler : connectListener {type: onConnectSuccess}
[log] [OpenIM] onConnectSuccess
[flutter_openim_sdk] ** Flutter Handler : connectListener {type: onConnecting}
[log] [OpenIM] onConnecting
[flutter_openim_sdk] ** Flutter Handler : conversationListener {type: onSyncServerFailed}
[flutter_openim_sdk] ** Flutter Handler : conversationListener {type: onSyncServerStart}
2
I/F-OpenIMSDK(native call flutter)(28736): method: 【 getSelfUserInfo 】, onSuccess: {"userID":"85","nickname":"","faceURL":"","createTime":1698032101988,"ex":"","attachedInfo":"","globalRecvMsgOpt":0}
I/F-OpenIMSDK(native call flutter)(28736): { method:connectListener,  type:onConnectSuccess }
I/F-OpenIMSDK(native call flutter)(28736): { method:conversationListener,  type:onSyncServerStart }
I/F-OpenIMSDK(native call flutter)(28736): { method:connectListener,  type:onKickedOffline }
I/GoLog   (28736): 2023-10-23 06:30:49.443  WARN    [PID:28736] [interaction/long_conn_mgr.go:166]  readPump closed {"operationID": "1698042651290839990", "error": "client kicked offline"}
I/GoLog   (28736): 2023-10-23 06:30:49.444  WARN    [PID:28736] [interaction/long_conn_mgr.go:275]  heartbeat closed    {"operationID": "1698042651290839990", "heartbeat": "heartbeat done sdk logout....."}
I/GoLog   (28736): 2023-10-23 06:30:49.444  ERROR   [PID:28736] [interaction/msg_sync.go:196]   get max seq error   {"operationID": "1698042648333", "error": "10003 CtxDeadlineExceededError"}
I/GoLog   (28736): 2023-10-23 06:30:49.445  WARN    [PID:28736] [interaction/long_conn_mgr.go:275]  heartbeat closed    {"operationID": "1698042651290839990", "heartbeat": "heartbeat done sdk logout....."}
I/GoLog   (28736): 2023-10-23 06:30:49.445  ERROR   [PID:28736] [util/post.go:77]   ApiRequest  {"operationID": "1698042648332", "type": "network error", "error": "Post \"http://172.105.107.69:9005/msg/get_conversations_has_read_and_max_seq\": context canceled"}
I/GoLog   (28736): 2023-10-23 06:30:49.445  ERROR   [PID:28736] [util/post.go:55]   CallApi {"operationID": "1698042648332", "api": "/msg/get_conversations_has_read_and_max_seq", "state": "failed", "cost time": 516, "error": "ApiPost http.Client.Do failed Post \"http://172.105.107.69:9005/msg/get_conversations_has_read_and_max_seq\": context canceled: 10000 NetworkError"}
I/GoLog   (28736): 2023-10-23 06:30:49.445  ERROR   [PID:28736] [conversation_msg/conversation.go:78]   getServerHasReadAndMaxSeqs err  {"operationID": "1698042648332", "error": "ApiPost http.Client.Do failed Post \"http://172.105.107.69:9005/msg/get_conversations_has_read_and_max_seq\": context canceled: 10000 NetworkError"}
I/F-OpenIMSDK(native call flutter)(28736): { method:connectListener,  type:onConnecting }
[flutter_openim_sdk] ** Flutter Handler : connectListener {type: onConnectSuccess}
[log] [OpenIM] onConnectSuccess
[flutter_openim_sdk] ** Flutter Handler : conversationListener {type: onSyncServerStart}
I/GoLog   (28736): 2023-10-23 06:30:49.445  ERROR   [PID:28736] [conversation_msg/conversation_notification.go:640] SyncConversationHashReadSeqs err    {"operationID": "1698042648332", "error": "ApiPost http.Client.Do failed Post \"http://172.105.107.69:9005/msg/get_conversations_has_read_and_max_seq\": context canceled: 10000 NetworkError"}
I/GoLog   (28736): 2023-10-23 06:30:49.445  WARN    [PID:28736] [interaction/long_conn_mgr.go:409]  conn closed {"operationID": "1698042651290839990", "error": "context canceled"}
I/GoLog   (28736): 2023-10-23 06:30:49.446  ERROR   [PID:28736] [interaction/long_conn_mgr.go:191]  readMessage err {"operationID": "1698042651290839990", "goroutine ID:": 135, "error": "read tcp 10.255.0.1:48463->172.105.107.69:9003: use of closed network connection"}
I/GoLog   (28736): 2023-10-23 06:30:49.447  ERROR   [PID:28736] [util/post.go:77]   ApiRequest  {"operationID": "1698042648332", "type": "network error", "error": "Post \"http://172.105.107.69:9005/group/get_user_req_group_applicationList\": context canceled"}
I/GoLog   (28736): 2023-10-23 06:30:49.447  ERROR   [PID:28736] [util/post.go:77]   ApiRequest  {"operationID": "1698042648332", "type": "network error", "error": "Post \"http://172.105.107.69:9005/user/get_users_info\": context canceled"}
I/GoLog   (28736): 2023-10-23 06:30:49.448  ERROR   [PID:28736] [util/post.go:55]   CallApi {"operationID": "1698042648332", "api": "/user/get_users_info", "state": "failed", "cost time": 0, "error": "ApiPost http.Client.Do failed Post \"http://172.105.107.69:9005/user/get_users_info\": context canceled: 10000 NetworkError"}
I/GoLog   (28736): 2023-10-23 06:30:49.448  ERROR   [PID:28736] [util/post.go:55]   CallApi {"operationID": "1698042648332", "api": "/group/get_user_req_group_applicationList", "state": "failed", "cost time": 2, "error": "ApiPost http.Client.Do failed Post \"http://172.105.107.69:9005/group/get_user_req_group_applicationList\": context canceled: 10000 NetworkError"}
I/GoLog   (28736): 2023-10-23 06:30:49.445  ERROR   [PID:28736] [util/post.go:77]   ApiRequest  {"operationID": "1698042648333", "type": "network error", "error": "Post \"http://172.105.107.69:9005/msg/get_conversations_has_read_and_max_seq\": context canceled"}
I/GoLog   (28736): 2023-10-23 06:30:49.448  ERROR   [PID:28736] [util/post.go:55]   CallApi {"operationID": "1698042648333", "api": "/msg/get_conversations_has_read_and_max_seq", "state": "failed", "cost time": 12, "error": "ApiPost http.Client.Do failed Post \"http://172.105.107.69:9005/msg/get_conversations_has_read_and_max_seq\": context canceled: 10000 NetworkError"}
I/GoLog   (28736): 2023-10-23 06:30:49.448  ERROR   [PID:28736] [conversation_msg/conversation.go:78]   getServerHasReadAndMaxSeqs err  {"operationID": "1698042648333", "error": "ApiPost http.Client.Do failed Post \"http://172.105.107.69:9005/msg/get_conversations_has_read_and_max_seq\": context canceled: 10000 NetworkError"}
I/GoLog   (28736): 2023-10-23 06:30:49.448  ERROR   [PID:28736] [conversation_msg/conversation_notification.go:640] SyncConversationHashReadSeqs err    {"operationID": "1698042648333", "error": "ApiPost http.Client.Do failed Post \"http://172.105.107.69:9005/msg/get_conversations_has_read_and_max_seq\": context canceled: 10000 NetworkError"}
I/GoLog   (28736): 2023-10-23 06:30:49.448  ERROR   [PID:28736] [util/post.go:77]   ApiRequest  {"operationID": "1698042648332", "type": "network error", "error": "Post \"http://172.105.107.69:9005/friend/get_friend_list\": context canceled"}
I/GoLog   (28736): 2023-10-23 06:30:49.448  ERROR   [PID:28736] [util/post.go:55]   CallApi {"operationID": "1698042648332", "api": "/friend/get_friend_list", "state": "failed", "cost time": 2, "error": "ApiPost http.Client.Do failed Post \"http://172.105.107.69:9005/friend/get_friend_list\": context canceled: 10000 NetworkError"}
I/GoLog   (28736): 2023-10-23 06:30:49.448  ERROR   [PID:28736] [util/post.go:77]   ApiRequest  {"operationID": "1698042648332", "type": "network error", "error": "Post \"http://172.105.107.69:9005/friend/get_black_list\": context canceled"}
I/GoLog   (28736): 2023-10-23 06:30:49.448  ERROR   [PID:28736] [util/post.go:55]   CallApi {"operationID": "1698042648332", "api": "/friend/get_black_list", "state": "failed", "cost time": 2, "error": "ApiPost http.Client.Do failed Post \"http://172.105.107.69:9005/friend/get_black_list\": context canceled: 10000 NetworkError"}
I/GoLog   (28736): 2023-10-23 06:30:49.448  ERROR   [PID:28736] [util/post.go:77]   ApiRequest  {"operationID": "1698042648333", "type": "network error", "error": "Post \"http://172.105.107.69:9005/group/get_user_req_group_applicationList\": context canceled"}
I/GoLog   (28736): 2023-10-23 06:30:49.448  ERROR   [PID:28736] [util/post.go:55]   CallApi {"operationID": "1698042648333", "api": "/group/get_user_req_group_applicationList", "state": "failed", "cost time": 0, "error": "ApiPost http.Client.Do failed Post \"http://172.105.107.69:9005/group/get_user_req_group_applicationList\": context canceled: 10000 NetworkError"}
I/GoLog   (28736): 2023-10-23 06:30:49.448  ERROR   [PID:28736] [util/post.go:77]   ApiRequest  {"operationID": "1698042648332", "type": "network error", "error": "Post \"http://172.105.107.69:9005/friend/get_friend_apply_list\": context canceled"}
I/GoLog   (28736): 2023-10-23 06:30:49.448  ERROR   [PID:28736] [util/post.go:55]   CallApi {"operationID": "1698042648332", "api": "/friend/get_friend_apply_list", "state": "failed", "cost time": 0, "error": "ApiPost http.Client.Do failed Post \"http://172.105.107.69:9005/friend/get_friend_apply_list\": context canceled: 10000 NetworkError"}
I/GoLog   (28736): 2023-10-23 06:30:49.448  ERROR   [PID:28736] [util/post.go:77]   ApiRequest  {"operationID": "1698042648333", "type": "network error", "error": "Post \"http://172.105.107.69:9005/user/get_users_info\": context canceled"}
I/GoLog   (28736): 2023-10-23 06:30:49.448  ERROR   [PID:28736] [util/post.go:55]   CallApi {"operationID": "1698042648333", "api": "/user/get_users_info", "state": "failed", "cost time": 0, "error": "ApiPost http.Client.Do failed Post \"http://172.105.107.69:9005/user/get_users_info\": context canceled: 10000 NetworkError"}
I/GoLog   (28736): 2023-10-23 06:30:49.449  ERROR   [PID:28736] [util/post.go:77]   ApiRequest  {"operationID": "1698042648332", "type": "network error", "error": "Post \"http://172.105.107.69:9005/friend/get_self_friend_apply_list\": context canceled"}
I/GoLog   (28736): 2023-10-23 06:30:49.449  ERROR   [PID:28736] [util/post.go:55]   CallApi {"operationID": "1698042648332", "api": "/friend/get_self_friend_apply_list", "state": "failed", "cost time": 0, "error": "ApiPost http.Client.Do failed Post \"http://172.105.107.69:9005/friend/get_self_friend_apply_list\": context canceled: 10000 NetworkError"}
I/GoLog   (28736): 2023-10-23 06:30:49.449  ERROR   [PID:28736] [util/post.go:77]   ApiRequest  {"operationID": "1698042648333", "type": "network error", "error": "Post \"http://172.105.107.69:9005/friend/get_black_list\": context canceled"}
I/GoLog   (28736): 2023-10-23 06:30:49.449  ERROR   [PID:28736] [util/post.go:55]   CallApi {"operationID": "1698042648333", "api": "/friend/get_black_list", "state": "failed", "cost time": 0, "error": "ApiPost http.Client.Do failed Post \"http://172.105.107.69:9005/friend/get_black_list\": context canceled: 10000 NetworkError"}
I/GoLog   (28736): 2023-10-23 06:30:49.449  ERROR   [PID:28736] [util/post.go:77]   ApiRequest  {"operationID": "1698042648332", "type": "network error", "error": "Post \"http://172.105.107.69:9005/group/get_joined_group_list\": context canceled"}
I/GoLog   (28736): 2023-10-23 06:30:49.449  ERROR   [PID:28736] [util/post.go:77]   ApiRequest  {"operationID": "1698042648333", "type": "network error", "error": "Post \"http://172.105.107.69:9005/friend/get_friend_list\": context canceled"}
I/GoLog   (28736): 2023-10-23 06:30:49.449  ERROR   [PID:28736] [util/post.go:55]   CallApi {"operationID": "1698042648332", "api": "/group/get_joined_group_list", "state": "failed", "cost time": 0, "error": "ApiPost http.Client.Do failed Post \"http://172.105.107.69:9005/group/get_joined_group_list\": context canceled: 10000 NetworkError"}
I/GoLog   (28736): 2023-10-23 06:30:49.449  ERROR   [PID:28736] [util/post.go:55]   CallApi {"operationID": "1698042648333", "api": "/friend/get_friend_list", "state": "failed", "cost time": 0, "error": "ApiPost http.Client.Do failed Post \"http://172.105.107.69:9005/friend/get_friend_list\": context canceled: 10000 NetworkError"}
I/GoLog   (28736): 2023-10-23 06:30:49.449  ERROR   [PID:28736] [util/post.go:77]   ApiRequest  {"operationID": "1698042648333", "type": "network error", "error": "Post \"http://172.105.107.69:9005/friend/get_self_friend_apply_list\": context canceled"}
I/GoLog   (28736): 2023-10-23 06:30:49.449  ERROR   [PID:28736] [util/post.go:77]   ApiRequest  {"operationID": "1698042648332", "type": "network error", "error": "Post \"http://172.105.107.69:9005/group/get_recv_group_applicationList\": context canceled"}
I/GoLog   (28736): 2023-10-23 06:30:49.449  ERROR   [PID:28736] [util/post.go:55]   CallApi {"operationID": "1698042648333", "api": "/friend/get_self_friend_apply_list", "state": "failed", "cost time": 0, "error": "ApiPost http.Client.Do failed Post \"http://172.105.107.69:9005/friend/get_self_friend_apply_list\": context canceled: 10000 NetworkError"}
I/GoLog   (28736): 2023-10-23 06:30:49.449  ERROR   [PID:28736] [util/post.go:77]   ApiRequest  {"operationID": "1698042648333", "type": "network error", "error": "Post \"http://172.105.107.69:9005/group/get_joined_group_list\": context canceled"}
I/GoLog   (28736): 2023-10-23 06:30:49.449  ERROR   [PID:28736] [util/post.go:77]   ApiRequest  {"operationID": "1698042648333", "type": "network error", "error": "Post \"http://172.105.107.69:9005/friend/get_friend_apply_list\": context canceled"}
I/GoLog   (28736): 2023-10-23 06:30:49.449  ERROR   [PID:28736] [util/post.go:55]   CallApi {"operationID": "1698042648333", "api": "/friend/get_friend_apply_list", "state": "failed", "cost time": 0, "error": "ApiPost http.Client.Do failed Post \"http://172.105.107.69:9005/friend/get_friend_apply_list\": context canceled: 10000 NetworkError"}
I/GoLog   (28736): 2023-10-23 06:30:49.449  ERROR   [PID:28736] [util/post.go:55]   CallApi {"operationID": "1698042648333", "api": "/group/get_joined_group_list", "state": "failed", "cost time": 0, "error": "ApiPost http.Client.Do failed Post \"http://172.105.107.69:9005/group/get_joined_group_list\": context canceled: 10000 NetworkError"}
I/GoLog   (28736): 2023-10-23 06:30:49.449  ERROR   [PID:28736] [util/post.go:77]   ApiRequest  {"operationID": "1698042648333", "type": "network error", "error": "Post \"http://172.105.107.69:9005/group/get_recv_group_applicationList\": context canceled"}
I/GoLog   (28736): 2023-10-23 06:30:49.449  ERROR   [PID:28736] [util/post.go:55]   CallApi {"operationID": "1698042648333", "api": "/group/get_recv_group_applicationList", "state": "failed", "cost time": 0, "error": "ApiPost http.Client.Do failed Post \"http://172.105.107.69:9005/group/get_recv_group_applicationList\": context canceled: 10000 NetworkError"}
I/F-OpenIMSDK(native call flutter)(28736): { method:conversationListener,  type:onSyncServerFailed }
[flutter_openim_sdk] ** Flutter Handler : connectListener {type: onKickedOffline}
[flutter_openim_sdk] ** Flutter Handler : connectListener {type: onConnecting}
[log] [OpenIM] onConnecting
[flutter_openim_sdk] ** Flutter Handler : conversationListener {type: onSyncServerFailed}
I/F-OpenIMSDK(native call flutter)(28736): { method:connectListener,  type:onConnectSuccess }
[flutter_openim_sdk] ** Flutter Handler : connectListener {type: onConnectSuccess}
[log] [OpenIM] onConnectSuccess
E/Go      (28736): panic: close of closed channel
E/Go      (28736):
E/Go      (28736): goroutine 136 [running]:
E/Go      (28736): github.com/openimsdk/openim-sdk-core/v3/internal/interaction.(*LongConnMgr).writePump.func1()
E/Go      (28736):  github.com/openimsdk/openim-sdk-core/v3@v3.0.0-00010101000000-000000000000/internal/interaction/long_conn_mgr.go:227 +0x34
E/Go      (28736): github.com/openimsdk/openim-sdk-core/v3/internal/interaction.(*LongConnMgr).writePump(0x40004080c0, {0x737cae3a88, 0x40000a16b0})
E/Go      (28736):  github.com/openimsdk/openim-sdk-core/v3@v3.0.0-00010101000000-000000000000/internal/interaction/long_conn_mgr.go:233 +0x87c
E/Go      (28736): created by github.com/openimsdk/openim-sdk-core/v3/internal/interaction.(*LongConnMgr).Run
E/Go      (28736):  github.com/openimsdk/openim-sdk-core/v3@v3.0.0-00010101000000-000000000000/internal/interaction/long_conn_mgr.go:120 +0x10c
F/libc    (28736): Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 28999 (Thread-14), pid 28736 (ouds.tworoamers)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'xiaomi/whyred/whyred:9/PKQ1.180904.001/V12.0.3.0.PEICNXM:user/release-keys'
Revision: '0'
ABI: 'arm64'
pid: 28736, tid: 28999, name: Thread-14  >>> com.shyclouds.tworoamers <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
    x0  0000000000000000  x1  0000000000007147  x2  0000000000000006  x3  0000000000000008
    x4  0000000000000001  x5  0000000000000000  x6  000000737c15c408  x7  000000000000000a
    x8  0000000000000083  x9  000000737cff6260  x10 000000000000007d  x11 00000000171fc301
    x12 0000000000000018  x13 000000006536131e  x14 001a140196388eb0  x15 0000bb0f92becd85
    x16 0000007350845b90  x17 0000007350941310  x18 0000000000000008  x19 0000000000007040
    x20 0000007350940ee0  x21 0000004000101000  x22 0000000000000001  x23 000000000000005a
    x24 0000007350941570  x25 0000007350844000  x26 0000000000000000  x27 00000000000002d0
    x28 0000004000612820  x29 0000004000509c68
    sp  0000004000509c70  lr  000000737c1da804  pc  000000737c1f5338
backtrace:
    #00 pc 0000000000372338  /data/app/com.shyclouds.tworoamers-LSwOgtIL_Ek2su43tMMdSw==/lib/arm64/libgojni.so (offset 0x30e000)
FGadvancer commented 10 months ago

You can try using the latest version 3.4, including the server, to see if the issue persists. In our testing with the new version, we were unable to reproduce this problem.

shirne commented 10 months ago

sdk 3.4.0 Failure to connect to the server causes the APP to become unresponsive.

I/F-OpenIMSDK(native call flutter)(22263): { method:connectListener,  type:onConnectSuccess }
I/GoLog   (22263): 2023-11-14 05:09:47.440  ERROR   [PID:22263] [interaction/msg_sync.go:222]   get max seq error   {"operationID": "1699938586774", "error": "10000 NetworkError"}
I/F-OpenIMSDK(native call flutter)(22263): { method:connectListener,  type:onConnecting }
I/F-OpenIMSDK(native call flutter)(22263): { method:conversationListener,  type:onSyncServerStart }
[flutter_openim_sdk] ** Flutter Handler : connectListener {type: onConnecting}
[flutter_openim_sdk] ** Flutter Handler : conversationListener {type: onSyncServerStart}
[flutter_openim_sdk] ** Flutter Handler : conversationListener {type: onSyncServerFailed}
I/GoLog   (22263): 2023-11-14 05:09:47.978  WARN    [PID:22263] [interaction/long_conn_mgr.go:167]  readPump closed {"operationID": "1699938590902101035", "error": "client kicked offline"}
I/F-OpenIMSDK(native call flutter)(22263): { method:connectListener,  type:onKickedOffline }
E/Go      (22263): panic: close of closed channel
E/Go      (22263):
E/Go      (22263): goroutine 14 [running]:
E/Go      (22263): github.com/openimsdk/openim-sdk-core/v3/internal/interaction.(*LongConnMgr).writePump.func1()
E/Go      (22263):  github.com/openimsdk/openim-sdk-core/v3@v3.0.0-00010101000000-000000000000/internal/interaction/long_conn_mgr.go:228 +0x34
E/Go      (22263): github.com/openimsdk/openim-sdk-core/v3/internal/interaction.(*LongConnMgr).writePump(0x40003b0000, {0x7a486ddce8, 0x4000560480})
E/Go      (22263):  github.com/openimsdk/openim-sdk-core/v3@v3.0.0-00010101000000-000000000000/internal/interaction/long_conn_mgr.go:234 +0x87c
E/Go      (22263): created by github.com/openimsdk/openim-sdk-core/v3/internal/interaction.(*LongConnMgr).Run
E/Go      (22263):  github.com/openimsdk/openim-sdk-core/v3@v3.0.0-00010101000000-000000000000/internal/interaction/long_conn_mgr.go:120 +0x10c
shyandsy commented 10 months ago

sing the latest version 3.4, including the server, to see if the issue persists. In our testing with the new version, we were unable to reproduce this problem.

could you provide your server branch version?

FGadvancer commented 10 months ago

sing the latest version 3.4, including the server, to see if the issue persists. In our testing with the new version, we were unable to reproduce this problem.

could you provide your server branch version?

Branch:release-v3.4

FGadvancer commented 10 months ago

sdk 3.4.0 Failure to connect to the server causes the APP to become unresponsive.

I/F-OpenIMSDK(native call flutter)(22263): { method:connectListener,  type:onConnectSuccess }
I/GoLog   (22263): 2023-11-14 05:09:47.440    ERROR   [PID:22263] [interaction/msg_sync.go:222]   get max seq error   {"operationID": "1699938586774", "error": "10000 NetworkError"}
I/F-OpenIMSDK(native call flutter)(22263): { method:connectListener,  type:onConnecting }
I/F-OpenIMSDK(native call flutter)(22263): { method:conversationListener,  type:onSyncServerStart }
[flutter_openim_sdk] ** Flutter Handler : connectListener {type: onConnecting}
[flutter_openim_sdk] ** Flutter Handler : conversationListener {type: onSyncServerStart}
[flutter_openim_sdk] ** Flutter Handler : conversationListener {type: onSyncServerFailed}
I/GoLog   (22263): 2023-11-14 05:09:47.978    WARN    [PID:22263] [interaction/long_conn_mgr.go:167]  readPump closed {"operationID": "1699938590902101035", "error": "client kicked offline"}
I/F-OpenIMSDK(native call flutter)(22263): { method:connectListener,  type:onKickedOffline }
E/Go      (22263): panic: close of closed channel
E/Go      (22263):
E/Go      (22263): goroutine 14 [running]:
E/Go      (22263): github.com/openimsdk/openim-sdk-core/v3/internal/interaction.(*LongConnMgr).writePump.func1()
E/Go      (22263):    github.com/openimsdk/openim-sdk-core/v3@v3.0.0-00010101000000-000000000000/internal/interaction/long_conn_mgr.go:228 +0x34
E/Go      (22263): github.com/openimsdk/openim-sdk-core/v3/internal/interaction.(*LongConnMgr).writePump(0x40003b0000, {0x7a486ddce8, 0x4000560480})
E/Go      (22263):    github.com/openimsdk/openim-sdk-core/v3@v3.0.0-00010101000000-000000000000/internal/interaction/long_conn_mgr.go:234 +0x87c
E/Go      (22263): created by github.com/openimsdk/openim-sdk-core/v3/internal/interaction.(*LongConnMgr).Run
E/Go      (22263):    github.com/openimsdk/openim-sdk-core/v3@v3.0.0-00010101000000-000000000000/internal/interaction/long_conn_mgr.go:120 +0x10c

I have updated the status order in PR https://github.com/openimsdk/openim-sdk-core/pull/417 to try and fix the issue. Meanwhile, I suspect a concurrent scenario where an old connection was being cleared at the same time as the login interface was being called. This could result in the second login referencing the context of the previous connection, leading to a duplicate close. Could you please provide detailed information about your phone model, the operating system version, and your strategy for handling app callbacks in the foreground? Specifically, do you verify the login status before logging in, or do you follow a different approach? This information will help me pinpoint the issue more accurately.

Thank you for your assistance. If the issue persists, please feel free to join our Slack 🤖 for further communication with me.

kubbot commented 8 months ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

kubbot commented 8 months ago

This issue was closed because it has been stalled for 7 days with no activity.