Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
G
getty
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wei.xuan
getty
Commits
b6e5ac9c
Commit
b6e5ac9c
authored
Sep 07, 2016
by
alexstocks
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add panic stack info
parent
444d54ed
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
5 deletions
+19
-5
README.md
README.md
+4
-0
session.go
session.go
+14
-4
version.go
version.go
+1
-1
No files found.
README.md
View file @
b6e5ac9c
...
...
@@ -13,6 +13,10 @@
-
2016/09/07
> 1 session.go:(Session)Close() -> session.go:(Session)gc() to be invoked by session.go:(Session)handleLoop
>
> 2 add panic stack message for session.go:(Session)handleLoop & session.go:(Session)handlePackage
>
> 3 version: 0.3.05
-
2016/09/06
> 1 codec.go:(Reader)Read(*Session, []byte) (interface{}, error) -> codec.go:(Reader)Read(*Session, []byte) (interface{}, int, error)
...
...
session.go
View file @
b6e5ac9c
...
...
@@ -21,6 +21,7 @@ import (
import
(
log
"github.com/AlexStocks/log4go"
"runtime"
)
const
(
...
...
@@ -353,8 +354,12 @@ func (this *Session) handleLoop() {
defer
func
()
{
var
grNum
int32
if
err
:=
recover
();
err
!=
nil
{
log
.
Error
(
"%s, [session.handleLoop] err=%+v
\n
"
,
this
.
sessionToken
(),
err
)
if
r
:=
recover
();
r
!=
nil
{
const
size
=
64
<<
10
rBuf
:=
make
([]
byte
,
size
)
rBuf
=
rBuf
[
:
runtime
.
Stack
(
rBuf
,
false
)]
log
.
Error
(
"[session.handleLoop] panic session %s: err=%#v
\n
%s"
,
this
.
sessionToken
(),
r
,
rBuf
)
}
grNum
=
atomic
.
AddInt32
(
&
(
this
.
grNum
),
-
1
)
...
...
@@ -433,9 +438,14 @@ func (this *Session) handlePackage() {
defer
func
()
{
var
grNum
int32
if
err
:=
recover
();
err
!=
nil
{
log
.
Error
(
"%s, [session.handlePackage] = err{%+v}"
,
this
.
sessionToken
(),
err
)
if
r
:=
recover
();
r
!=
nil
{
const
size
=
64
<<
10
rBuf
:=
make
([]
byte
,
size
)
rBuf
=
rBuf
[
:
runtime
.
Stack
(
rBuf
,
false
)]
log
.
Error
(
"[session.handlePackage] panic session %s: err=%#v
\n
%s"
,
this
.
sessionToken
(),
r
,
rBuf
)
}
this
.
stop
()
close
(
this
.
readerDone
)
grNum
=
atomic
.
AddInt32
(
&
(
this
.
grNum
),
-
1
)
...
...
version.go
View file @
b6e5ac9c
...
...
@@ -10,5 +10,5 @@
package
getty
var
(
Version
=
"0.3.0
4
"
Version
=
"0.3.0
5
"
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment