gotd / td

Telegram client, in Go. (MTProto API)
MIT License
1.46k stars 128 forks source link

bug: client can't recover from connection loss #1030

Open ernado opened 1 year ago

ernado commented 1 year ago

Logs: https://gist.github.com/ernado/a9aa2b9b8ca02f65087013b3973b6cc0

Related: #1021

Upvote & Fund

Fund with Polar

borzovplus commented 1 year ago

this is easy to reproduce if you connect an account that consists of very large groups with a large flow of messages (several chats with 1000 messages per hour will be enough)

iyear commented 11 months ago

Hi, any news?

Logs:

After received EOF, client can't recover from connection loss

It prints Some connection dead, try to create new connection, cancel waiting and successfully Read loop started, but then Closing DC

ernado commented 8 months ago

Sorry, no news.

I'll try to debug it yet another time, but not sure that will succeed.

ernado commented 8 months ago

I'm trying to find a way to reproduce this issue. Tried something like that:

sudo ss -K dst 149.154.167.50

Just closing connection does not reproduce this issue, so probably another way is needed.

If anobody have ideas how to reproduce it in controlled environment (I'm using echobot started locally) I will be very happy.

ernado commented 8 months ago

I've tried to reproduce it in #1293 using kubernetes + cilium network policy rules, but no success either.

ernado commented 7 months ago
Error: group:
    github.com/gotd/td/internal/mtproto.(*Conn).Run
        github.com/gotd/td@v0.89.0/internal/mtproto/conn.go:214
  - task readLoop:
    github.com/gotd/td/internal/tdsync.(*LogGroup).Go.func1
        github.com/gotd/td@v0.89.0/internal/tdsync/log_group.go:48
  - read:
    github.com/gotd/td/internal/mtproto.(*Conn).readLoop
        github.com/gotd/td@v0.89.0/internal/mtproto/read.go:193
  - read:
    github.com/gotd/td/transport.(*connection).Recv
        github.com/gotd/td@v0.89.0/transport/connection.go:70
  - read intermediate:
    github.com/gotd/td/internal/proto/codec.Intermediate.Read
        github.com/gotd/td@v0.89.0/internal/proto/codec/intermediate.go:73
  - read length:
    github.com/gotd/td/internal/proto/codec.readLen
        github.com/gotd/td@v0.89.0/internal/proto/codec/codec.go:35
  - EOF
gulldan commented 5 months ago

issuing same on v0.99.2

sevenineone commented 5 months ago

+, problem still exists on v0.99.2

ffrxp commented 5 months ago

+, I confirm this issue, it continues to exist on v0.99.2 :(

zyjsmabshncuos commented 5 months ago

+, problem still exists on v0.99.2

ernado commented 5 months ago

Hey, I’m aware of this issue, but it is not trivial to fix.

This issue is my top priority, that’s why it is still pinned.

To make this issue fixed one can:

  1. Fix it yourself, it is easier to do with reproducer
  2. Provide a relatively easy reproducer so I can fix it faster
  3. Fund this issue so I can allocate more time to it
  4. Upvote

Anyway, thank you for using gotd and keeping this issue alive 💜This will be eventually fixed by me.