Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Openfire
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Administrator
Openfire
Commits
7d7d3fd0
Commit
7d7d3fd0
authored
Mar 20, 2015
by
Guus der Kinderen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OF-894: Do not attempt to close a session that is already closing.
parent
6716afbf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
+13
-11
StalledSessionsFilter.java
.../org/jivesoftware/openfire/net/StalledSessionsFilter.java
+13
-11
No files found.
src/java/org/jivesoftware/openfire/net/StalledSessionsFilter.java
View file @
7d7d3fd0
...
...
@@ -47,17 +47,19 @@ public class StalledSessionsFilter extends IoFilterAdapter {
@Override
public
void
filterWrite
(
NextFilter
nextFilter
,
IoSession
session
,
WriteRequest
writeRequest
)
throws
Exception
{
// Get number of pending requests
long
pendingBytes
=
session
.
getScheduledWriteBytes
();
if
(
pendingBytes
>
bytesCap
)
{
// Get last time we were able to send something to the connected client
long
writeTime
=
session
.
getLastWriteTime
();
int
pendingRequests
=
session
.
getScheduledWriteMessages
();
Log
.
debug
(
"About to kill session with pendingBytes: "
+
pendingBytes
+
" pendingWrites: "
+
pendingRequests
+
" lastWrite: "
+
new
Date
(
writeTime
)
+
"session: "
+
session
);
// Close the session and throw an exception
session
.
close
(
false
);
throw
new
IOException
(
"Closing session that seems to be stalled. Preventing OOM"
);
if
(!
session
.
isClosing
())
{
// Get number of pending requests
long
pendingBytes
=
session
.
getScheduledWriteBytes
();
if
(
pendingBytes
>
bytesCap
)
{
// Get last time we were able to send something to the connected client
long
writeTime
=
session
.
getLastWriteTime
();
int
pendingRequests
=
session
.
getScheduledWriteMessages
();
Log
.
debug
(
"About to kill session with pendingBytes: "
+
pendingBytes
+
" pendingWrites: "
+
pendingRequests
+
" lastWrite: "
+
new
Date
(
writeTime
)
+
"session: "
+
session
);
// Close the session and throw an exception
session
.
close
(
false
);
throw
new
IOException
(
"Closing session that seems to be stalled. Preventing OOM"
);
}
}
// Call next filter (everything is fine)
super
.
filterWrite
(
nextFilter
,
session
,
writeRequest
);
...
...
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