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

MessagesSendMessage freezes forever #1363

Open
TrixiS opened this issue Apr 18, 2024 · 3 comments
Open

MessagesSendMessage freezes forever #1363

TrixiS opened this issue Apr 18, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@TrixiS
Copy link

TrixiS commented Apr 18, 2024

Description: After some time of running a client MessagesSendMessage request sleeps forever. Seems like a deadlock, but I am not really sure. Some debug logs provided below

What version of gotd are you using?

github.com/gotd/td v0.99.2

Can this issue be reproduced with the latest version?

Yes

What did you do?

API.MessagesSendMessage

What did you expect to see?

A message to be sent

What did you see instead?

MessagesSendMessage method sleeps forever

What Go version and environment are you using?

go version go1.21.1 linux/amd64

GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/root/.cache/go-build'
GOENV='/root/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='local'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.21.1'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/app/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1773707187=/tmp/go-build -gno-record-gcc-switches'

I run MessagesSendMessage with timeout of 5 minutes, context closes

Debug logs:

{"level":"debug","ts":1713448933.1994636,"logger":"conn.mtproto","caller":"mtproto/new_encrypted_msg.go:62","msg":"Request","v":"v0.99.2","conn_id":0,"dc_id":2,"type_id":"0xf3427b8c","type_name":"ping_delay_disconnect#f3427b8c","msg_id":7359207130800523400}
{"level":"debug","ts":1713448933.1996253,"logger":"conn.mtproto.group","caller":"tdsync/cancel_group.go:48","msg":"Task stopped","v":"v0.99.2","conn_id":0,"dc_id":2,"task":"pingLoop","error":"disconnect (pong missed): write: write: write intermediate: write tcp 188.120.255.161:60372->149.154.167.51:443: write: broken pipe","errorVerbose":"disconnect (pong missed):\n    github.com/gotd/td/mtproto.(*Conn).pingLoop\n        /go/pkg/mod/github.com/gotd/[email protected]/mtproto/ping.go:115\n  - write:\n    github.com/gotd/td/mtproto.(*Conn).pingDelayDisconnect\n        /go/pkg/mod/github.com/gotd/[email protected]/mtproto/ping.go:71\n  - write:\n    github.com/gotd/td/transport.(*connection).Send\n        /go/pkg/mod/github.com/gotd/[email protected]/transport/connection.go:48\n  - write intermediate:\n    github.com/gotd/td/proto/codec.Intermediate.Write\n        /go/pkg/mod/github.com/gotd/[email protected]/proto/codec/intermediate.go:64\n  - write tcp 188.120.255.161:60372->149.154.167.51:443: write: broken pipe","elapsed":60300.000978525}
{"level":"debug","ts":1713448933.1999178,"logger":"conn.mtproto","caller":"mtproto/conn.go:172","msg":"Closing","v":"v0.99.2","conn_id":0,"dc_id":2}
{"level":"info","ts":1713448933.1999276,"logger":"conn.mtproto.rpc","caller":"rpc/engine.go:271","msg":"Close called","v":"v0.99.2","conn_id":0,"dc_id":2}
{"level":"debug","ts":1713448933.1999583,"logger":"conn.mtproto.group","caller":"tdsync/cancel_group.go:48","msg":"Task stopped","v":"v0.99.2","conn_id":0,"dc_id":2,"task":"ackLoop","error":"acl: context canceled","errorVerbose":"acl:\n    github.com/gotd/td/mtproto.(*Conn).ackLoop\n        /go/pkg/mod/github.com/gotd/[email protected]/mtproto/ack.go:33\n  - context canceled","elapsed":60300.00136314}
{"level":"debug","ts":1713448933.2000499,"logger":"conn.mtproto.group","caller":"tdsync/cancel_group.go:48","msg":"Task complete","v":"v0.99.2","conn_id":0,"dc_id":2,"task":"handleClose","elapsed":60300.001440411}
@TrixiS TrixiS added the bug Something isn't working label Apr 18, 2024
@ernado
Copy link
Member

ernado commented Apr 18, 2024

Looks like #1030

@TrixiS
Copy link
Author

TrixiS commented Apr 18, 2024

Looks like #1030

Yeah. All I do is listening to hundreds of channels and sending messages in one to many manner. So it's kinda like this person said

@TrixiS
Copy link
Author

TrixiS commented Apr 18, 2024

Application restart helps tho

@ernado ernado changed the title subject: short description MessagesSendMessage freezes forever Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants