Skip to content

Commit 54f8bef

Browse files
Merge pull request #404 from ava-labs/rework-stacktrace
Rework stacktrace
2 parents 09a45f1 + d807092 commit 54f8bef

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

.ci/run_e2e_tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ AVALANCHE_IMAGE=$(docker image ls --format="{{.Repository}}" | head -n 1)
77
DOCKER_REPO="avaplatform"
88

99
E2E_TESTING_REMOTE="https://github.com/ava-labs/avalanche-testing.git"
10-
E2E_TAG="v0.9.2-dev"
10+
E2E_TAG="v0.9.3-dev.1"
1111

1212
mkdir -p "$E2E_TEST_HOME"
1313
git clone "$E2E_TESTING_REMOTE" "$E2E_TEST_HOME"

api/admin/service.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package admin
55

66
import (
77
"errors"
8+
"io/ioutil"
89
"net/http"
910

1011
"github.com/gorilla/rpc/v2"
@@ -19,6 +20,9 @@ import (
1920

2021
const (
2122
maxAliasLength = 512
23+
24+
// Name of file that stacktraces are written to
25+
stacktraceFile = "stacktrace.txt"
2226
)
2327

2428
var (
@@ -124,15 +128,11 @@ func (service *Admin) AliasChain(_ *http.Request, args *AliasChainArgs, reply *a
124128
return service.httpServer.AddAliasesWithReadLock("bc/"+chainID.String(), "bc/"+args.Alias)
125129
}
126130

127-
// StacktraceReply are the results from calling Stacktrace
128-
type StacktraceReply struct {
129-
Stacktrace string `json:"stacktrace"`
130-
}
131-
132131
// Stacktrace returns the current global stacktrace
133-
func (service *Admin) Stacktrace(_ *http.Request, _ *struct{}, reply *StacktraceReply) error {
132+
func (service *Admin) Stacktrace(_ *http.Request, _ *struct{}, reply *api.SuccessResponse) error {
134133
service.log.Info("Admin: Stacktrace called")
135134

136-
reply.Stacktrace = logging.Stacktrace{Global: true}.String()
137-
return nil
135+
reply.Success = true
136+
stacktrace := []byte(logging.Stacktrace{Global: true}.String())
137+
return ioutil.WriteFile(stacktraceFile, stacktrace, 0644)
138138
}

network/network.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -949,6 +949,8 @@ func (n *network) upgrade(p *peer, upgrader Upgrader) error {
949949
return nil
950950
}
951951

952+
// assumes the stateLock is not held. Returns an error if the peer couldn't be
953+
// added.
952954
func (n *network) tryAddPeer(p *peer) error {
953955
key := p.id.Key()
954956

node/node.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ var (
6464
genesisHashKey = []byte("genesisID")
6565

6666
// Version is the version of this code
67-
Version = version.NewDefaultVersion(constants.PlatformName, 0, 8, 2)
67+
Version = version.NewDefaultVersion(constants.PlatformName, 0, 8, 3)
6868
versionParser = version.NewDefaultParser()
6969
)
7070

0 commit comments

Comments
 (0)