Skip to content

Commit

Permalink
vendor: docker/docker 471fd27709777d2, remove use of pkg/signals
Browse files Browse the repository at this point in the history
full diff: moby/moby@0ad2293...471fd27

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
thaJeztah committed Jul 22, 2021
1 parent 2dcf70a commit 3cd1651
Show file tree
Hide file tree
Showing 19 changed files with 77 additions and 720 deletions.
23 changes: 21 additions & 2 deletions manager/state/raft/raft.go
Expand Up @@ -7,6 +7,8 @@ import (
"math"
"math/rand"
"net"
"os"
"runtime"
"sync"
"sync/atomic"
"time"
Expand All @@ -15,7 +17,6 @@ import (
"github.com/coreos/etcd/pkg/idutil"
"github.com/coreos/etcd/raft"
"github.com/coreos/etcd/raft/raftpb"
"github.com/docker/docker/pkg/signal"
"github.com/docker/go-events"
"github.com/docker/go-metrics"
"github.com/docker/swarmkit/api"
Expand Down Expand Up @@ -594,7 +595,7 @@ func (n *Node) Run(ctx context.Context) error {
transferLeadershipLimit.Allow() {
log.G(ctx).Error("Attempting to transfer leadership")
if !n.opts.DisableStackDump {
signal.DumpStacks("")
stackDump()
}
transferee, err := n.transport.LongestActive()
if err != nil {
Expand Down Expand Up @@ -2131,3 +2132,21 @@ func getIDs(snap *raftpb.Snapshot, ents []raftpb.Entry) []uint64 {
func (n *Node) reqTimeout() time.Duration {
return 5*time.Second + 2*time.Duration(n.Config.ElectionTick)*n.opts.TickInterval
}

// stackDump outputs the runtime stack to os.StdErr.
//
// It is based on Moby's stack.Dump(); https://github.com/moby/moby/blob/471fd27709777d2cce3251129887e14e8bb2e0c7/pkg/stack/stackdump.go#L41-L57
func stackDump() {
var (
buf []byte
stackSize int
)
bufferLen := 16384
for stackSize == len(buf) {
buf = make([]byte, bufferLen)
stackSize = runtime.Stack(buf, true)
bufferLen *= 2
}
buf = buf[:stackSize]
_, _ = os.Stderr.Write(buf)
}
2 changes: 1 addition & 1 deletion vendor.conf
Expand Up @@ -31,7 +31,7 @@ github.com/prometheus/procfs 46159f73e74d1cb8dc223deef9b2
github.com/cespare/xxhash/v2 d7df74196a9e781ede915320c11c378c1b2f3a1f # v2.1.1

github.com/docker/distribution 0d3efadf0154c2b8a4e7b6621fff9809655cc580
github.com/docker/docker 0ad2293d0e5bbf4c966a0e8b27c3ac3835265577 # master / v21.xx-dev
github.com/docker/docker 471fd27709777d2cce3251129887e14e8bb2e0c7 # master / v21.xx-dev
github.com/docker/go-connections 7395e3f8aa162843a74ed6d48e79627d9792ac55 # v0.4.0
github.com/docker/go-events e31b211e4f1cd09aa76fe4ac244571fab96ae47f
github.com/docker/go-units 519db1ee28dcc9fd2474ae59fca29a810482bfb1 # v0.4.0
Expand Down
2 changes: 1 addition & 1 deletion vendor/github.com/docker/docker/api/common.go

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

14 changes: 12 additions & 2 deletions vendor/github.com/docker/docker/api/types/client.go

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

9 changes: 7 additions & 2 deletions vendor/github.com/docker/docker/api/types/types.go

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

17 changes: 10 additions & 7 deletions vendor/github.com/docker/docker/client/request.go

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

202 changes: 0 additions & 202 deletions vendor/github.com/docker/docker/libnetwork/LICENSE

This file was deleted.

12 changes: 6 additions & 6 deletions vendor/github.com/docker/docker/libnetwork/README.md

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

1 change: 0 additions & 1 deletion vendor/github.com/docker/docker/pkg/signal/README.md

This file was deleted.

0 comments on commit 3cd1651

Please sign in to comment.