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

Delete topic sometimes can't receive ctrl response #726

Closed
ppaanngggg opened this issue Feb 21, 2022 · 8 comments
Closed

Delete topic sometimes can't receive ctrl response #726

ppaanngggg opened this issue Feb 21, 2022 · 8 comments
Labels

Comments

@ppaanngggg
Copy link
Contributor

Subject of the issue

When user delete a topic from topic list, the Client should wait for response to confirm delete succeed and remove this topic from UI.
But sometimes the Client can't receive the response and timeout.

Your environment

Server-side

  • [*] Your own setup:
    • Linux
    • 0.18.0-rc3
    • mongo
    • cluster with 3 nodes

Client-side

  • [*] TinodeWeb/tinodejs: javascript client
    • Edge 98

Steps to reproduce

  1. create a grp topic;
  2. login and sub this topic, and then delete;
  3. logout and repeat 2;

Expected behaviour

Should always works

Actual behaviour

when delete grp topic, there are two situations.

  1. not work, client send del request, but ctrl response lost, warning timeout and the grp topic remains.
  • image
  • image
  1. work, send del and get ctrl, then client delete the grp topic
@ppaanngggg ppaanngggg added the bug label Feb 21, 2022
@or-else
Copy link
Contributor

or-else commented Feb 21, 2022

I cannot reproduce. Please attach the full log (ideally as text). Thanks.

@ppaanngggg
Copy link
Contributor Author

ppaanngggg commented Feb 22, 2022

1. normal case

  • connect to node3 and login
  • sub grpJFExaNFtKYw, and this topic run on node3 (according to status api)
  • delete by {"del":{"id":"79108","topic":"grpJFExaNFtKYw","what":"topic","hard":true}}
  • and receive {"ctrl":{"id":"79108","topic":"grpJFExaNFtKYw","code":200,"text":"ok","ts":"2022-02-22T02:07:33.408Z"}}

node3 logs:

I2022/02/22 02:03:56 ws: session started lmYcdFRASm0 10.244.144.186:51792 1
I2022/02/22 02:03:56 in: '{"hi":{"id":"79103","ver":"0.18.0-rc3","ua":"TinodeWeb/0.18.0-rc3 (Edge/98.0; Win32); tinodejs/0.18.0-rc3","lang":"zh-CN","platf":"web"}}' sid='lmYcdFRASm0' uid=''
I2022/02/22 02:03:56 in: '{"login":{"id":"79104","scheme":"basic","secret":"dGVzdDE6MTIzNDU2"}}' sid='lmYcdFRASm0' uid=''
I2022/02/22 02:03:56 in: '{"sub":{"id":"79105","topic":"me","get":{"what":"sub desc tags cred"}}}' sid='lmYcdFRASm0' uid='zBDuSfneWZ8'
I2022/02/22 02:04:55 in: '{"sub":{"id":"79106","topic":"fnd","get":{"what":"sub"}}}' sid='lmYcdFRASm0' uid='zBDuSfneWZ8'
I2022/02/22 02:04:59 in: '{"sub":{"id":"79107","topic":"grpJFExaNFtKYw","get":{"data":{"limit":24},"what":"data sub desc"}}}' sid='lmYcdFRASm0' uid='zBDuSfneWZ8'
I2022/02/22 02:07:33 in: '{"del":{"id":"79108","topic":"grpJFExaNFtKYw","what":"topic","hard":true}}' sid='lmYcdFRASm0' uid='zBDuSfneWZ8'

node3 status:

{
    "server_version": "0.18",
    "build_id": "v0.18.0-rc3",
    "ts": "2022-02-22T02:44:08.557Z",
    "sessions":
    [
        {
            "remote_addr": "10.244.144.186:51792",
            "ua": "TinodeWeb/0.18.0-rc3 (Edge/98.0; Win32); tinodejs/0.18.0-rc3",
            "uid": "zBDuSfneWZ8",
            "sid": "lmYcdFRASm0",
            "subs":
            [
                "fndzBDuSfneWZ8",
                "usrzBDuSfneWZ8"
            ]
        }
    ],
    "topics":
    [
        {
            "topic": "usrzBDuSfneWZ8",
            "xorig": "me",
            "per_user":
            [
                "zBDuSfneWZ8"
            ],
            "per_subs":
            [
                "fndzBDuSfneWZ8"
            ],
            "sessions":
            [
                "lmYcdFRASm0"
            ]
        },
        {
            "topic": "fndzBDuSfneWZ8",
            "xorig": "fnd",
            "is_proxy": true,
            "cat": 1,
            "per_user":
            [
                "zBDuSfneWZ8"
            ],
            "sessions":
            [
                "lmYcdFRASm0"
            ]
        },
        {
            "topic": "grpJFExaNFtKYw",
            "xorig": "grpJFExaNFtKYw",
            "cat": 3
        }
    ]
}

2. abnormal case

  • connect to node2 and login
  • sub grpJFExaNFtKYw, this topic still run on node3, but there is proxy sessions and topics
  • delete by {"del":{"id":"108242","topic":"grpJFExaNFtKYw","what":"topic","hard":true}}
  • never receive ctrl like normal case, and show image

node2 log

I2022/02/22 02:55:55 ws: session started gDpLuz0q1uU 10.244.144.186:38834 1
I2022/02/22 02:55:55 in: '{"hi":{"id":"108237","ver":"0.18.0-rc3","ua":"TinodeWeb/0.18.0-rc3 (Edge/98.0; Win32); tinodejs/0.18.0-rc3","lang":"zh-CN","platf":"web"}}' sid='gDpLuz0q1uU' uid=''
I2022/02/22 02:55:55 in: '{"login":{"id":"108238","scheme":"basic","secret":"dGVzdDE6MTIzNDU2"}}' sid='gDpLuz0q1uU' uid=''
I2022/02/22 02:55:55 in: '{"sub":{"id":"108239","topic":"me","get":{"what":"sub desc tags cred"}}}' sid='gDpLuz0q1uU' uid='zBDuSfneWZ8'
I2022/02/22 02:56:36 in: '{"sub":{"id":"108240","topic":"fnd","get":{"what":"sub"}}}' sid='gDpLuz0q1uU' uid='zBDuSfneWZ8'
I2022/02/22 02:56:46 in: '{"sub":{"id":"108241","topic":"grpJFExaNFtKYw","get":{"data":{"limit":24},"what":"data sub desc"}}}' sid='gDpLuz0q1uU' uid='zBDuSfneWZ8'
W2022/02/22 02:56:46 proxy topic[usrzBDuSfneWZ8]: received acs change for invalid user id 'grpJFExaNFtKYw'
W2022/02/22 02:56:46 proxy topic[usrzBDuSfneWZ8]: received acs change for invalid user id 'grpJFExaNFtKYw'
W2022/02/22 02:56:46 proxy topic[usrzBDuSfneWZ8]: received acs change for invalid user id 'grpJFExaNFtKYw'
I2022/02/22 03:07:20 in: '{"del":{"id":"108242","topic":"grpJFExaNFtKYw","what":"topic","hard":true}}' sid='gDpLuz0q1uU' uid='zBDuSfneWZ8'

node3 log

I2022/02/22 02:55:55 cluster: multiplexing session started usrzBDuSfneWZ8-tinode-2 1
I2022/02/22 02:56:46 cluster: multiplexing session started grpJFExaNFtKYw-tinode-2 2
I2022/02/22 03:07:20 cluster: detach msg received grpJFExaNFtKYw-tinode-2
I2022/02/22 03:07:20 cluster: session proxy closed grpJFExaNFtKYw-tinode-2

node2 debug status before delete grp

{
    "server_version": "0.18",
    "build_id": "v0.18.0-rc3",
    "ts": "2022-02-22T03:04:42.293Z",
    "sessions":
    [
        {
            "remote_addr": "10.244.144.186:38834",
            "ua": "TinodeWeb/0.18.0-rc3 (Edge/98.0; Win32); tinodejs/0.18.0-rc3",
            "uid": "zBDuSfneWZ8",
            "sid": "gDpLuz0q1uU",
            "subs":
            [
                "fndzBDuSfneWZ8",
                "grpJFExaNFtKYw",
                "usrzBDuSfneWZ8"
            ]
        }
    ],
    "topics":
    [
        {
            "topic": "usrzBDuSfneWZ8",
            "xorig": "me",
            "is_proxy": true,
            "per_user":
            [
                "zBDuSfneWZ8"
            ],
            "sessions":
            [
                "gDpLuz0q1uU"
            ]
        },
        {
            "topic": "fndzBDuSfneWZ8",
            "xorig": "fnd",
            "cat": 1,
            "per_user":
            [
                "zBDuSfneWZ8"
            ],
            "sessions":
            [
                "gDpLuz0q1uU"
            ]
        },
        {
            "topic": "grpJFExaNFtKYw",
            "xorig": "grpJFExaNFtKYw",
            "is_proxy": true,
            "cat": 3,
            "per_user":
            [
                "zBDuSfneWZ8"
            ],
            "sessions":
            [
                "gDpLuz0q1uU"
            ]
        },
        {
            "topic": "sys",
            "xorig": "sys",
            "cat": 4
        }
    ]
}

node3 debug status before delete grp

{
    "server_version": "0.18",
    "build_id": "v0.18.0-rc3",
    "ts": "2022-02-22T02:58:20.642Z",
    "sessions":
    [
        {
            "sid": "usrzBDuSfneWZ8-tinode-2",
            "clnode": "tinode-2",
            "subs":
            [
                "usrzBDuSfneWZ8"
            ]
        },
        {
            "sid": "grpJFExaNFtKYw-tinode-2",
            "clnode": "tinode-2",
            "subs":
            [
                "grpJFExaNFtKYw"
            ]
        }
    ],
    "topics":
    [
        {
            "topic": "usrzBDuSfneWZ8",
            "xorig": "me",
            "per_user":
            [
                "zBDuSfneWZ8"
            ],
            "per_subs":
            [
                "fndzBDuSfneWZ8",
                "grpJFExaNFtKYw"
            ],
            "sessions":
            [
                "usrzBDuSfneWZ8-tinode-2"
            ]
        },
        {
            "topic": "grpJFExaNFtKYw",
            "xorig": "grpJFExaNFtKYw",
            "cat": 3,
            "per_user":
            [
                "zBDuSfneWZ8"
            ],
            "sessions":
            [
                "grpJFExaNFtKYw-tinode-2"
            ]
        }
    ]
}

node2 debug status after delete grp

{
    "server_version": "0.18",
    "build_id": "v0.18.0-rc3",
    "ts": "2022-02-22T03:13:01.928Z",
    "sessions":
    [
        {
            "remote_addr": "10.244.144.186:38834",
            "ua": "TinodeWeb/0.18.0-rc3 (Edge/98.0; Win32); tinodejs/0.18.0-rc3",
            "uid": "zBDuSfneWZ8",
            "sid": "gDpLuz0q1uU",
            "subs":
            [
                "fndzBDuSfneWZ8",
                "usrzBDuSfneWZ8"
            ]
        }
    ],
    "topics":
    [
        {
            "topic": "sys",
            "xorig": "sys",
            "cat": 4
        },
        {
            "topic": "usrzBDuSfneWZ8",
            "xorig": "me",
            "is_proxy": true,
            "per_user":
            [
                "zBDuSfneWZ8"
            ],
            "sessions":
            [
                "gDpLuz0q1uU"
            ]
        },
        {
            "topic": "fndzBDuSfneWZ8",
            "xorig": "fnd",
            "cat": 1,
            "per_user":
            [
                "zBDuSfneWZ8"
            ],
            "sessions":
            [
                "gDpLuz0q1uU"
            ]
        },
        {
            "topic": "grpJFExaNFtKYw",
            "xorig": "grpJFExaNFtKYw",
            "is_proxy": true,
            "cat": 3,
            "per_user":
            [
                "zBDuSfneWZ8"
            ]
        }
    ]
}

node3 debug status after delete grp

{
    "server_version": "0.18",
    "build_id": "v0.18.0-rc3",
    "ts": "2022-02-22T03:15:58.475Z",
    "sessions":
    [
        {
            "sid": "usrzBDuSfneWZ8-tinode-2",
            "clnode": "tinode-2",
            "subs":
            [
                "usrzBDuSfneWZ8"
            ]
        }
    ],
    "topics":
    [
        {
            "topic": "usrzBDuSfneWZ8",
            "xorig": "me",
            "per_user":
            [
                "zBDuSfneWZ8"
            ],
            "per_subs":
            [
                "fndzBDuSfneWZ8"
            ],
            "sessions":
            [
                "usrzBDuSfneWZ8-tinode-2"
            ]
        }
    ]
}

or-else added a commit that referenced this issue Feb 22, 2022
@or-else
Copy link
Contributor

or-else commented Feb 22, 2022

It should be fixed now. Please verify.
Thanks!

@ppaanngggg
Copy link
Contributor Author

Great!
Could you please push a new image tagged with rc to docker hub?

@or-else
Copy link
Contributor

or-else commented Feb 23, 2022

Will push in a couple of days.

@ppaanngggg
Copy link
Contributor Author

Thx, I will test it when you pushed.

@or-else
Copy link
Contributor

or-else commented Mar 1, 2022

Docker v0.18.2-rc1 released.

@ppaanngggg
Copy link
Contributor Author

Docker v0.18.2-rc1 released.

Great! I think it works now.

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

No branches or pull requests

2 participants