Skip to content

Commit

Permalink
bugfix: bid >= 0
Browse files Browse the repository at this point in the history
  • Loading branch information
davies committed Sep 7, 2014
1 parent e0131a2 commit 6325fc1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ private[spark] class PythonRDD(
for (bid <- bids) {
if (!nbids.contains(bid)) {
// remove the broadcast from worker
dataOut.writeLong(-bid)
dataOut.writeLong(- bid - 1) // bid >= 0
bids.remove(bid)
}
}
Expand Down
5 changes: 3 additions & 2 deletions python/pyspark/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,12 @@ def main(infile, outfile):
ser = CompressedSerializer(pickleSer)
for _ in range(num_broadcast_variables):
bid = read_long(infile)
if bid > 0:
if bid >= 0:
value = ser._read_with_length(infile)
_broadcastRegistry[bid] = Broadcast(bid, value)
else:
_broadcastRegistry.pop(-bid, None)
bid = - bid - 1
_broadcastRegistry.pop(bid, None)

command = pickleSer._read_with_length(infile)
(func, deserializer, serializer) = command
Expand Down

0 comments on commit 6325fc1

Please sign in to comment.