Skip to content

Commit 3629f50

Browse files
authored
Merge pull request #3021 from thaJeztah/replace_pkg_signal
vendor: docker/docker 471fd27709777d2, remove use of pkg/signals
2 parents 2dcf70a + 3cd1651 commit 3629f50

File tree

19 files changed

+77
-720
lines changed

19 files changed

+77
-720
lines changed

manager/state/raft/raft.go

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import (
77
"math"
88
"math/rand"
99
"net"
10+
"os"
11+
"runtime"
1012
"sync"
1113
"sync/atomic"
1214
"time"
@@ -15,7 +17,6 @@ import (
1517
"github.com/coreos/etcd/pkg/idutil"
1618
"github.com/coreos/etcd/raft"
1719
"github.com/coreos/etcd/raft/raftpb"
18-
"github.com/docker/docker/pkg/signal"
1920
"github.com/docker/go-events"
2021
"github.com/docker/go-metrics"
2122
"github.com/docker/swarmkit/api"
@@ -594,7 +595,7 @@ func (n *Node) Run(ctx context.Context) error {
594595
transferLeadershipLimit.Allow() {
595596
log.G(ctx).Error("Attempting to transfer leadership")
596597
if !n.opts.DisableStackDump {
597-
signal.DumpStacks("")
598+
stackDump()
598599
}
599600
transferee, err := n.transport.LongestActive()
600601
if err != nil {
@@ -2131,3 +2132,21 @@ func getIDs(snap *raftpb.Snapshot, ents []raftpb.Entry) []uint64 {
21312132
func (n *Node) reqTimeout() time.Duration {
21322133
return 5*time.Second + 2*time.Duration(n.Config.ElectionTick)*n.opts.TickInterval
21332134
}
2135+
2136+
// stackDump outputs the runtime stack to os.StdErr.
2137+
//
2138+
// It is based on Moby's stack.Dump(); https://github.com/moby/moby/blob/471fd27709777d2cce3251129887e14e8bb2e0c7/pkg/stack/stackdump.go#L41-L57
2139+
func stackDump() {
2140+
var (
2141+
buf []byte
2142+
stackSize int
2143+
)
2144+
bufferLen := 16384
2145+
for stackSize == len(buf) {
2146+
buf = make([]byte, bufferLen)
2147+
stackSize = runtime.Stack(buf, true)
2148+
bufferLen *= 2
2149+
}
2150+
buf = buf[:stackSize]
2151+
_, _ = os.Stderr.Write(buf)
2152+
}

vendor.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ github.com/prometheus/procfs 46159f73e74d1cb8dc223deef9b2
3131
github.com/cespare/xxhash/v2 d7df74196a9e781ede915320c11c378c1b2f3a1f # v2.1.1
3232

3333
github.com/docker/distribution 0d3efadf0154c2b8a4e7b6621fff9809655cc580
34-
github.com/docker/docker 0ad2293d0e5bbf4c966a0e8b27c3ac3835265577 # master / v21.xx-dev
34+
github.com/docker/docker 471fd27709777d2cce3251129887e14e8bb2e0c7 # master / v21.xx-dev
3535
github.com/docker/go-connections 7395e3f8aa162843a74ed6d48e79627d9792ac55 # v0.4.0
3636
github.com/docker/go-events e31b211e4f1cd09aa76fe4ac244571fab96ae47f
3737
github.com/docker/go-units 519db1ee28dcc9fd2474ae59fca29a810482bfb1 # v0.4.0

vendor/github.com/docker/docker/api/common.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/docker/docker/api/types/client.go

Lines changed: 12 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/docker/docker/api/types/types.go

Lines changed: 7 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/docker/docker/client/request.go

Lines changed: 10 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/docker/docker/libnetwork/LICENSE

Lines changed: 0 additions & 202 deletions
This file was deleted.

vendor/github.com/docker/docker/libnetwork/README.md

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/docker/docker/pkg/signal/README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)