Skip to content

Commit

Permalink
Merge branch 'master' into connection
Browse files Browse the repository at this point in the history
  • Loading branch information
meling committed Mar 26, 2024
2 parents 2dd48d7 + 480ea63 commit 32d9e81
Show file tree
Hide file tree
Showing 55 changed files with 402 additions and 310 deletions.
4 changes: 4 additions & 0 deletions .vscode/gorums.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Meland's
Meling
memprofile
multicast
naddr
obj's
Paxos
Pedersen
Expand All @@ -53,6 +54,8 @@ protoc
protogen
protoimpl
protoreflect
protoregistry
protowire
ptypes
QCQF
qcresult
Expand All @@ -78,6 +81,7 @@ unicast
unmarshal
unmarshaled
unmarshaling
unmarshals
userguide
Xeon
Zorums
8 changes: 4 additions & 4 deletions async.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (c RawConfiguration) handleAsyncCall(ctx context.Context, fut *Async, state

var (
resp protoreflect.ProtoMessage
errs []Error
errs []nodeError
quorum bool
replies = make(map[uint32]protoreflect.ProtoMessage)
)
Expand All @@ -87,7 +87,7 @@ func (c RawConfiguration) handleAsyncCall(ctx context.Context, fut *Async, state
select {
case r := <-state.replyChan:
if r.err != nil {
errs = append(errs, Error{r.nid, r.err})
errs = append(errs, nodeError{nodeID: r.nid, cause: r.err})
break
}
replies[r.nid] = r.msg
Expand All @@ -96,11 +96,11 @@ func (c RawConfiguration) handleAsyncCall(ctx context.Context, fut *Async, state
return
}
case <-ctx.Done():
fut.reply, fut.err = resp, QuorumCallError{ctx.Err().Error(), len(replies), errs}
fut.reply, fut.err = resp, QuorumCallError{cause: ctx.Err(), errors: errs, replies: len(replies)}
return
}
if len(errs)+len(replies) == state.expectedReplies {
fut.reply, fut.err = resp, QuorumCallError{"incomplete call", len(replies), errs}
fut.reply, fut.err = resp, QuorumCallError{cause: Incomplete, errors: errs, replies: len(replies)}
return
}
}
Expand Down
4 changes: 2 additions & 2 deletions benchmark/benchmark.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions benchmark/benchmark_gorums.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions cmd/protoc-gen-gorums/dev/mgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func NewManager(opts ...gorums.ManagerOption) (mgr *Manager) {
// using the And, WithNewNodes, Except, and WithoutNodes methods.
func (m *Manager) NewConfiguration(opts ...gorums.ConfigOption) (c *Configuration, err error) {
if len(opts) < 1 || len(opts) > 2 {
return nil, fmt.Errorf("wrong number of options: %d", len(opts))
return nil, fmt.Errorf("config: wrong number of options: %d", len(opts))
}
c = &Configuration{}
for _, opt := range opts {
Expand All @@ -51,13 +51,13 @@ func (m *Manager) NewConfiguration(opts ...gorums.ConfigOption) (c *Configuratio
// Must be last since v may match QuorumSpec if it is interface{}
c.qspec = v
default:
return nil, fmt.Errorf("unknown option type: %v", v)
return nil, fmt.Errorf("config: unknown option type: %v", v)
}
}
// return an error if the QuorumSpec interface is not empty and no implementation was provided.
var test interface{} = struct{}{}
if _, empty := test.(QuorumSpec); !empty && c.qspec == nil {
return nil, fmt.Errorf("missing required QuorumSpec")
return nil, fmt.Errorf("config: missing required QuorumSpec")
}
return c, nil
}
Expand Down
14 changes: 7 additions & 7 deletions cmd/protoc-gen-gorums/dev/zorums.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions cmd/protoc-gen-gorums/dev/zorums_async_gorums.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions cmd/protoc-gen-gorums/dev/zorums_correctable_gorums.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions cmd/protoc-gen-gorums/dev/zorums_multicast_gorums.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 32d9e81

Please sign in to comment.