Skip to content

Commit

Permalink
Closes #90: eqPly: Crash with direct send and 30 GPUs
Browse files Browse the repository at this point in the history
This was a race introduced by #82:

[rcv thread]
_handleData:
  dispatchCommand to instance1
    enqueue to foo thread

[foo thread]
  process command
  release command

[rcv thread]
  dispatch the same command to instance2
    cloneCommand
      compact cache
      free command [yee-ha!]

Fix by retaining the command during dispatch.

[ ] May break build
[ ] May break existing applications (see CHANGES.txt)
[x] Bugfix
[ ] New Feature
[ ] Cleanup
[ ] Optimization
[ ] Documentation
  • Loading branch information
eile committed Feb 10, 2012
1 parent cc7d7f8 commit a1c1ab3
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions libs/co/localNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1064,14 +1064,16 @@ Command& LocalNode::allocCommand( const uint64_t size )
void LocalNode::_dispatchCommand( Command& command )
{
EQASSERT( command.isValid( ));
command.retain();

const bool dispatched = dispatchCommand( command );

_redispatchCommands();

if( !dispatched )
if( dispatchCommand( command ))
{
command.release();
_redispatchCommands();
}
else
{
command.retain();
_redispatchCommands();
_pendingCommands.push_back( &command );
}
}
Expand Down

0 comments on commit a1c1ab3

Please sign in to comment.