-
Notifications
You must be signed in to change notification settings - Fork 7
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
Margot yoba branch #47
Conversation
@@ -1,2 +1,5 @@ | |||
vendor | |||
devbin/* | |||
go1.22.4.linux-amd64.tar.gz | |||
yezzey.log | |||
examples/yproxy.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
examples/yproxy.yaml definitely shouldn't persist here, as this file is committed into repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also go1.22.4.linux-amd64.tar.gz is not needed here
go func() { | ||
|
||
listener, err := net.Listen("unix", instanceCnf.InterconnectSocketPath) | ||
|
||
ylogger.Zero.Debug().Msg("try to start interconnect socket listener") | ||
if err != nil { | ||
ylogger.Zero.Error().Err(err).Msg("failed to start interconnect socket listener") | ||
return | ||
} | ||
defer listener.Close() | ||
|
||
for { | ||
clConn, err := listener.Accept() | ||
if err != nil { | ||
ylogger.Zero.Error().Err(err).Msg("failed to accept interconnection") | ||
continue | ||
} | ||
ylogger.Zero.Debug().Str("addr", clConn.LocalAddr().String()).Msg("accepted client interconnection") | ||
|
||
ycl := client.NewYClient(clConn) | ||
r := proc.NewProtoReader(ycl) | ||
|
||
mt, _, err := r.ReadPacket() | ||
|
||
if err != nil { | ||
ylogger.Zero.Error().Err(err).Msg("failed to accept interconnection") | ||
continue | ||
} | ||
|
||
switch mt { | ||
case message.MessageTypeGool: | ||
msg := message.ReadyForQueryMessage{} | ||
_, _ = ycl.GetRW().Write(msg.Encode()) | ||
default: | ||
ycl.ReplyError(fmt.Errorf("wrong message type"), "") | ||
|
||
} | ||
|
||
clConn.Close() | ||
ylogger.Zero.Debug().Msg("interconnection closed") | ||
} | ||
}() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is now can be done using i.DispatchServer utility
adding interconnection