Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
spark
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cs525-sp18-g07
spark
Commits
c230ca3b
Commit
c230ca3b
authored
11 years ago
by
Mridul Muralidharan
Browse files
Options
Downloads
Patches
Plain Diff
Change line size
parent
dc47084f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/src/main/scala/spark/network/Connection.scala
+9
-5
9 additions, 5 deletions
core/src/main/scala/spark/network/Connection.scala
with
9 additions
and
5 deletions
core/src/main/scala/spark/network/Connection.scala
+
9
−
5
View file @
c230ca3b
...
...
@@ -251,12 +251,15 @@ class SendingConnection(val address: InetSocketAddress, selector_ : Selector,
}
}
// outbox is used as a lock - ensure that it is always used as a leaf (since methods which
// lock it are invoked in context of other locks)
private
val
outbox
=
new
Outbox
(
1
)
/*
This is orthogonal to whether we have pending bytes to write or not - and satisfies a slightly different purpose.
This flag is to see if we need to force reregister for write even when we do not have any pending bytes to write to socket.
This can happen due to a race between adding pending buffers, and checking for existing of data as detailed in
https://github.com/mesos/spark/pull/791#issuecomment-22294729
This is orthogonal to whether we have pending bytes to write or not - and satisfies a slightly
different purpose. This flag is to see if we need to force reregister for write even when we
do not have any pending bytes to write to socket.
This can happen due to a race between adding pending buffers, and checking for existing of
data as detailed in https://github.com/mesos/spark/pull/791
*/
private
var
needForceReregister
=
false
val
currentBuffers
=
new
ArrayBuffer
[
ByteBuffer
]()
...
...
@@ -346,7 +349,8 @@ class SendingConnection(val address: InetSocketAddress, selector_ : Selector,
outbox
.
getChunk
()
match
{
case
Some
(
chunk
)
=>
{
val
buffers
=
chunk
.
buffers
// If we have 'seen' pending messages, then reset flag - since we handle that as normal registering of event (below)
// If we have 'seen' pending messages, then reset flag - since we handle that as normal
// registering of event (below)
if
(
needForceReregister
&&
buffers
.
exists
(
_
.
remaining
()
>
0
))
resetForceReregister
()
currentBuffers
++=
buffers
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment