Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* Bump golangci-lint to v2.1.6
* Fix leader resignation during a graceful shutdown by @osmman in https://github.com/google/trillian/pull/3790
* Add optional gRPC message size limit via `--max_msg_size_bytes` flag by @fghanmi in https://github.com/google/trillian/pull/3801

## v1.7.2

Expand Down
4 changes: 4 additions & 0 deletions cmd/trillian_log_server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ var (
// Profiling related flags.
cpuProfile = flag.String("cpuprofile", "", "If set, write CPU profile to this file")
memProfile = flag.String("memprofile", "", "If set, write memory profile to this file")
maxMsgSize = flag.Int("max_msg_size_bytes", 0, "Optional max gRPC message size in bytes")
)

func main() {
Expand Down Expand Up @@ -107,6 +108,9 @@ func main() {
options = append(options, opts...)
}

if *maxMsgSize > 0 {
options = append(options, grpc.MaxRecvMsgSize(*maxMsgSize))
}
sp, err := storage.NewProvider(*storageSystem, mf)
if err != nil {
klog.Exitf("Failed to get storage provider: %v", err)
Expand Down
6 changes: 6 additions & 0 deletions cmd/trillian_log_signer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ var (
// Profiling related flags.
cpuProfile = flag.String("cpuprofile", "", "If set, write CPU profile to this file")
memProfile = flag.String("memprofile", "", "If set, write memory profile to this file")
maxMsgSize = flag.Int("max_msg_size_bytes", 0, "Optional max gRPC message size in bytes")
)

func main() {
Expand Down Expand Up @@ -194,12 +195,17 @@ func main() {
defer pprof.StopCPUProfile()
}

var options []grpc.ServerOption
if *maxMsgSize > 0 {
options = append(options, grpc.MaxRecvMsgSize(*maxMsgSize))
}
m := serverutil.Main{
RPCEndpoint: *rpcEndpoint,
HTTPEndpoint: *httpEndpoint,
TLSCertFile: *tlsCertFile,
TLSKeyFile: *tlsKeyFile,
StatsPrefix: "logsigner",
ExtraOptions: options,
DBClose: sp.Close,
Registry: registry,
RegisterServerFn: func(s *grpc.Server, _ extension.Registry) error { return nil },
Expand Down
Loading