Skip to content

Commit

Permalink
DataStorm connection manager fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pepone committed Dec 17, 2024
1 parent b6d18ff commit fb89e23
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
19 changes: 6 additions & 13 deletions cpp/src/DataStorm/ConnectionManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ ConnectionManager::remove(const shared_ptr<void>& object, const Ice::ConnectionP
}

void
ConnectionManager::remove(const Ice::ConnectionPtr& connection)
ConnectionManager::remove(const Ice::ConnectionPtr& connection) noexcept
{
map<shared_ptr<void>, Callback> objects;
{
Expand All @@ -60,27 +60,20 @@ ConnectionManager::remove(const Ice::ConnectionPtr& connection)
connection->setCloseCallback(nullptr);
_connections.erase(p);
}

exception_ptr ex;
try
{
[[maybe_unused]] auto _ = connection->getInfo();
connection->throwException();
}
catch (const std::exception&)
{
ex = current_exception();
}
for (const auto& object : objects)

for (const auto& [_, callback] : objects)
{
try
{
object.second(connection, ex);
}
catch (const std::exception& e)
{
cerr << e.what() << endl;
assert(false);
throw;
}
callback(connection, ex);
}
_executor->flush();
}
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/DataStorm/ConnectionManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace DataStormI
std::function<void(const Ice::ConnectionPtr&, std::exception_ptr)>);

void remove(const std::shared_ptr<void>&, const Ice::ConnectionPtr&);
void remove(const Ice::ConnectionPtr&);
void remove(const Ice::ConnectionPtr&) noexcept;

void destroy();

Expand Down

0 comments on commit fb89e23

Please sign in to comment.