diff --git a/service/api/service.go b/service/api/service.go index e489518e..8ab7eb26 100644 --- a/service/api/service.go +++ b/service/api/service.go @@ -98,7 +98,7 @@ func (s *service) createDocument(w http.ResponseWriter, req *http.Request) { query = req.URL.Query() text = query.Get("text") ) - timeoutCtx, cancel := context.WithTimeout(context.Background(), time.Second*5) + timeoutCtx, cancel := context.WithTimeout(context.Background(), time.Second*30) treeId, err := s.documentService.CreateDocument(timeoutCtx, fmt.Sprintf("created document with id: %s", text)) cancel() if err != nil { @@ -114,7 +114,7 @@ func (s *service) appendDocument(w http.ResponseWriter, req *http.Request) { text = query.Get("text") treeId = query.Get("treeId") ) - timeoutCtx, cancel := context.WithTimeout(context.Background(), time.Second*5) + timeoutCtx, cancel := context.WithTimeout(context.Background(), time.Second*30) err := s.documentService.UpdateDocument(timeoutCtx, treeId, text) cancel() if err != nil { diff --git a/service/net/pool/message.go b/service/net/pool/message.go index bc067a12..e6cb38fe 100644 --- a/service/net/pool/message.go +++ b/service/net/pool/message.go @@ -3,6 +3,7 @@ package pool import ( "github.com/anytypeio/go-anytype-infrastructure-experiments/service/net/peer" "github.com/anytypeio/go-anytype-infrastructure-experiments/syncproto" + "go.uber.org/zap" "gopkg.in/mgo.v2/bson" ) @@ -43,6 +44,7 @@ func (m *Message) Ack() (err error) { }, Data: data, } + log.With(zap.String("header", rep.Header.String())).Info("sending ack to peer") return m.peer.Send(rep) } diff --git a/service/net/pool/pool.go b/service/net/pool/pool.go index fe57e16c..f4aa266f 100644 --- a/service/net/pool/pool.go +++ b/service/net/pool/pool.go @@ -15,7 +15,10 @@ import ( "sync/atomic" ) -const CName = "sync/peerPool" +const ( + CName = "sync/peerPool" + maxSimultaneousOperationsPerStream = 10 +) var log = logger.NewNamed("peerPool") @@ -45,7 +48,7 @@ type Pool interface { type pool struct { peersById map[string]*peerEntry - waiters waiters + waiters *waiters handlers map[syncproto.MessageType][]Handler peersIdsByGroup map[string][]string @@ -60,7 +63,7 @@ func (p *pool) Init(ctx context.Context, a *app.App) (err error) { p.peersById = map[string]*peerEntry{} p.handlers = map[syncproto.MessageType][]Handler{} p.peersIdsByGroup = map[string][]string{} - p.waiters = waiters{waiters: map[uint64]*waiter{}} + p.waiters = &waiters{waiters: map[uint64]*waiter{}} p.dialer = a.MustComponent(dialer.CName).(dialer.Dialer) p.wg = &sync.WaitGroup{} return nil @@ -160,6 +163,7 @@ func (p *pool) SendAndWait(ctx context.Context, peerId string, msg *syncproto.Me repId := p.waiters.NewReplyId() msg.GetHeader().RequestId = repId ch := make(chan Reply, 1) + log.With(zap.Uint64("reply id", repId)).Debug("adding waiter for reply id") p.waiters.Add(repId, &waiter{ch: ch}) defer p.waiters.Remove(repId) if err = peer.peer.Send(msg); err != nil { @@ -172,24 +176,41 @@ func (p *pool) SendAndWait(ctx context.Context, peerId string, msg *syncproto.Me } return nil case <-ctx.Done(): + log.Debug("context error happened in send and wait") return ctx.Err() } } func (p *pool) Broadcast(ctx context.Context, groupId string, msg *syncproto.Message) (err error) { + //TODO implement me panic("implement me") } func (p *pool) readPeerLoop(peer peer.Peer) (err error) { defer p.wg.Done() + limiter := make(chan struct{}, maxSimultaneousOperationsPerStream) + for i := 0; i < maxSimultaneousOperationsPerStream; i++ { + limiter <- struct{}{} + } +Loop: for { msg, err := peer.Recv() if err != nil { log.Debug("peer receive error", zap.Error(err), zap.String("peerId", peer.Id())) break } - p.handleMessage(peer, msg) + select { + case <-limiter: + case <-peer.Context().Done(): + break Loop + } + go func() { + defer func() { + limiter <- struct{}{} + }() + p.handleMessage(peer, msg) + }() } if err = p.removePeer(peer.Id()); err != nil { log.Error("remove peer error", zap.String("peerId", peer.Id())) @@ -209,7 +230,8 @@ func (p *pool) removePeer(peerId string) (err error) { } func (p *pool) handleMessage(peer peer.Peer, msg *syncproto.Message) { - log.With(zap.String("peerId", peer.Id())).Debug("received message from peer") + log.With(zap.String("peerId", peer.Id()), zap.String("header", msg.GetHeader().String())). + Debug("received message from peer") replyId := msg.GetHeader().GetReplyId() if replyId != 0 { if !p.waiters.Send(replyId, Reply{ @@ -219,7 +241,7 @@ func (p *pool) handleMessage(peer peer.Peer, msg *syncproto.Message) { peer: peer, }, }) { - log.Debug("received reply with unknown (or expired) replyId", zap.Uint64("replyId", replyId)) + log.Debug("received reply with unknown (or expired) replyId", zap.Uint64("replyId", replyId), zap.String("header", msg.GetHeader().String())) } return } @@ -262,7 +284,7 @@ type waiters struct { mu sync.Mutex } -func (w waiters) Send(replyId uint64, r Reply) (ok bool) { +func (w *waiters) Send(replyId uint64, r Reply) (ok bool) { w.mu.Lock() wait := w.waiters[replyId] if wait == nil { @@ -282,13 +304,13 @@ func (w waiters) Send(replyId uint64, r Reply) (ok bool) { return true } -func (w waiters) Add(replyId uint64, wait *waiter) { +func (w *waiters) Add(replyId uint64, wait *waiter) { w.mu.Lock() w.waiters[replyId] = wait w.mu.Unlock() } -func (w waiters) Remove(id uint64) error { +func (w *waiters) Remove(id uint64) error { w.mu.Lock() defer w.mu.Unlock() if _, ok := w.waiters[id]; ok { @@ -298,7 +320,7 @@ func (w waiters) Remove(id uint64) error { return fmt.Errorf("waiter not found") } -func (w waiters) NewReplyId() uint64 { +func (w *waiters) NewReplyId() uint64 { res := atomic.AddUint64(&w.replySeq, 1) if res == 0 { return w.NewReplyId() diff --git a/service/sync/message/service.go b/service/sync/message/service.go index 12c3a844..44e7e68c 100644 --- a/service/sync/message/service.go +++ b/service/sync/message/service.go @@ -63,6 +63,9 @@ func (s *service) HandleMessage(ctx context.Context, msg *pool.Message) (err err if err != nil { log.With(zap.String("peerId", msg.Peer().Id()), zap.Error(err)). Error("could not ack message") + } else { + log.With(zap.String("peerId", msg.Peer().Id()), zap.Int("type", int(msg.Header.Type))). + Debug("ack returned") } syncMsg := &syncproto.Sync{} err = proto.Unmarshal(msg.Data, syncMsg) @@ -70,7 +73,7 @@ func (s *service) HandleMessage(ctx context.Context, msg *pool.Message) (err err return err } - timeoutCtx, cancel := context.WithTimeout(ctx, time.Second*5) + timeoutCtx, cancel := context.WithTimeout(ctx, time.Second*30) defer cancel() return s.requestHandler.HandleSyncMessage(timeoutCtx, msg.Peer().Id(), syncMsg) } @@ -95,50 +98,26 @@ func (s *service) SendMessage(ctx context.Context, peerId string, msg *syncproto Header: &syncproto.Header{Type: syncproto.MessageType_MessageTypeSync}, Data: marshalled, }) + if err != nil { log.With( zap.String("peerId", peerId), zap.String("message", msgType(msg)), zap.Error(err)). - Error("failed to send message to peer") + Debug("failed to send message to peer") + } else { + log.With( + zap.String("peerId", peerId), + zap.String("message", msgType(msg))). + Debug("message send to peer completed") } return err } func (s *service) SendToSpace(ctx context.Context, spaceId string, msg *syncproto.Sync) error { - // dial manually to all peers for _, rp := range s.nodes { - if er := s.pool.DialAndAddPeer(context.Background(), rp.PeerId); er != nil { - log.Info("can't dial to peer", zap.Error(er)) - } else { - log.Info("connected with peer", zap.String("peerId", rp.PeerId)) - } + s.SendMessage(ctx, rp.PeerId, msg) } - - marshalled, err := proto.Marshal(msg) - if err != nil { - return err - } - - // TODO: use Broadcast method here when it is ready - for _, n := range s.nodes { - log.With( - zap.String("peerId", n.PeerId), - zap.String("message", msgType(msg))). - Debug("sending message to peer") - err := s.pool.SendAndWait(ctx, n.PeerId, &syncproto.Message{ - Header: &syncproto.Header{Type: syncproto.MessageType_MessageTypeSync}, - Data: marshalled, - }) - if err != nil { - log.With( - zap.String("peerId", n.PeerId), - zap.String("message", msgType(msg)), - zap.Error(err)). - Error("failed to send message to peer") - } - } - return nil } diff --git a/service/sync/requesthandler/requesthandler.go b/service/sync/requesthandler/requesthandler.go index 0c1bad55..cce5ab0b 100644 --- a/service/sync/requesthandler/requesthandler.go +++ b/service/sync/requesthandler/requesthandler.go @@ -164,7 +164,7 @@ func (r *requestHandler) HandleFullSyncRequest(ctx context.Context, senderId str TreeId: request.TreeId, TreeHeader: request.TreeHeader, } - return r.messageService.SendToSpace(ctx, "", syncproto.WrapHeadUpdate(newUpdate)) + return r.messageService.SendToSpace(ctx, "def", syncproto.WrapHeadUpdate(newUpdate)) } func (r *requestHandler) HandleFullSyncResponse(ctx context.Context, senderId string, response *syncproto.SyncFullResponse) (err error) { diff --git a/service/treecache/service.go b/service/treecache/service.go index 14a011a9..687300f0 100644 --- a/service/treecache/service.go +++ b/service/treecache/service.go @@ -15,6 +15,7 @@ import ( const CName = "treecache" +// TODO: add context type ACLTreeFunc = func(tree acltree.ACLTree) error type ChangeBuildFunc = func(builder acltree.ChangeBuilder) error diff --git a/syncproto/proto/sync.proto b/syncproto/proto/sync.proto index 1aa39e1a..284d6a34 100644 --- a/syncproto/proto/sync.proto +++ b/syncproto/proto/sync.proto @@ -15,6 +15,7 @@ message Header { uint64 requestId = 2; uint64 replyId = 3; MessageType type = 4; + string debugInfo = 5; } enum MessageType { diff --git a/syncproto/sync.pb.go b/syncproto/sync.pb.go index a002c37d..64ce8676 100644 --- a/syncproto/sync.pb.go +++ b/syncproto/sync.pb.go @@ -134,6 +134,7 @@ type Header struct { RequestId uint64 `protobuf:"varint,2,opt,name=requestId,proto3" json:"requestId,omitempty"` ReplyId uint64 `protobuf:"varint,3,opt,name=replyId,proto3" json:"replyId,omitempty"` Type MessageType `protobuf:"varint,4,opt,name=type,proto3,enum=anytype.MessageType" json:"type,omitempty"` + DebugInfo string `protobuf:"bytes,5,opt,name=debugInfo,proto3" json:"debugInfo,omitempty"` } func (m *Header) Reset() { *m = Header{} } @@ -197,6 +198,13 @@ func (m *Header) GetType() MessageType { return MessageType_MessageTypeSystem } +func (m *Header) GetDebugInfo() string { + if m != nil { + return m.DebugInfo + } + return "" +} + type System struct { Handshake *SystemHandshake `protobuf:"bytes,1,opt,name=handshake,proto3" json:"handshake,omitempty"` Ping *SystemPing `protobuf:"bytes,2,opt,name=ping,proto3" json:"ping,omitempty"` @@ -1020,61 +1028,62 @@ func init() { func init() { proto.RegisterFile("syncproto/proto/sync.proto", fileDescriptor_4b28dfdd48a89166) } var fileDescriptor_4b28dfdd48a89166 = []byte{ - // 851 bytes of a gzipped FileDescriptorProto - 0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, 0x80, 0x60, 0xab, 0xd1, 0x68, 0xd7, 0x64, 0x63, - 0x96, 0x27, 0x07, 0xf0, 0x6c, 0x87, 0xe3, 0x02, 0xc7, 0xf9, 0xbf, 0x02, 0x86, 0xe8, 0xd5, 0xf9, - 0x5d, 0x07, 0x33, 0x3f, 0xa5, 0x77, 0xab, 0x85, 0x3f, 0x74, 0xb8, 0x95, 0x3f, 0x95, 0x77, 0xcb, - 0xfa, 0xc3, 0x73, 0x68, 0x16, 0xbe, 0x55, 0xd0, 0x5d, 0x78, 0xaf, 0x10, 0xaa, 0xb9, 0x68, 0x69, - 0xe8, 0x1e, 0x7c, 0x50, 0x84, 0x0b, 0xa3, 0xc3, 0xd2, 0xd1, 0x6d, 0x38, 0xba, 0xa1, 0x61, 0xbe, - 0x55, 0x79, 0xf6, 0xe0, 0xaf, 0xab, 0x8e, 0xfe, 0xea, 0xaa, 0xa3, 0xff, 0x73, 0xd5, 0xd1, 0x5f, - 0x5e, 0x77, 0xb4, 0x57, 0xd7, 0x1d, 0xed, 0xef, 0xeb, 0x8e, 0xf6, 0x1d, 0x1c, 0xef, 0x7e, 0x07, - 0x5c, 0xd4, 0xe5, 0xc7, 0x67, 0xaf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x41, 0xe9, 0x79, 0xe5, 0x1b, - 0x08, 0x00, 0x00, + // 868 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x56, 0xd1, 0x8e, 0xda, 0x46, + 0x14, 0x65, 0xc0, 0x40, 0xb8, 0x20, 0xd6, 0x9d, 0x24, 0xad, 0xeb, 0x44, 0x08, 0xa1, 0xb4, 0x45, + 0x69, 0xe4, 0x8d, 0x68, 0xa3, 0x4a, 0x7d, 0x4b, 0xb6, 0xbb, 0x02, 0x35, 0x05, 0x34, 0xc0, 0x56, + 0xea, 0x4b, 0x34, 0xd8, 0x13, 0x40, 0x78, 0xc7, 0xae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ac, 0x3f, 0x3c, 0x87, 0x66, 0xee, 0x37, 0x07, 0xdf, 0x85, 0xf7, 0x72, 0xa1, 0x9e, 0x8b, + 0x66, 0x09, 0xdf, 0x83, 0x0f, 0xf2, 0x70, 0x6e, 0x74, 0x98, 0x08, 0xdf, 0x86, 0xa3, 0x6b, 0x1a, + 0xee, 0x9a, 0xe5, 0x67, 0x0f, 0xfe, 0xbc, 0xec, 0xa0, 0xd7, 0x97, 0x1d, 0xf4, 0xf7, 0x65, 0x07, + 0xbd, 0xba, 0xea, 0x94, 0x5e, 0x5f, 0x75, 0x4a, 0x7f, 0x5d, 0x75, 0x4a, 0xdf, 0xc1, 0xf1, 0xe1, + 0x5f, 0xc2, 0xb2, 0xa6, 0x3e, 0x3e, 0xfb, 0x3f, 0x00, 0x00, 0xff, 0xff, 0x7a, 0xad, 0xe7, 0x46, + 0x39, 0x08, 0x00, 0x00, } func (m *Message) Marshal() (dAtA []byte, err error) { @@ -1139,6 +1148,13 @@ func (m *Header) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.DebugInfo) > 0 { + i -= len(m.DebugInfo) + copy(dAtA[i:], m.DebugInfo) + i = encodeVarintSync(dAtA, i, uint64(len(m.DebugInfo))) + i-- + dAtA[i] = 0x2a + } if m.Type != 0 { i = encodeVarintSync(dAtA, i, uint64(m.Type)) i-- @@ -1887,6 +1903,10 @@ func (m *Header) Size() (n int) { if m.Type != 0 { n += 1 + sovSync(uint64(m.Type)) } + l = len(m.DebugInfo) + if l > 0 { + n += 1 + l + sovSync(uint64(l)) + } return n } @@ -2433,6 +2453,38 @@ func (m *Header) Unmarshal(dAtA []byte) error { break } } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DebugInfo", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSync + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSync + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSync + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DebugInfo = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipSync(dAtA[iNdEx:])