Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
ns3: live with the fact that sometimes finished_ becomes true with remains is still >0
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 11 Oct 2020 23:19:55 +0000 (01:19 +0200)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Mon, 12 Oct 2020 07:27:14 +0000 (09:27 +0200)
Thanks to Mahesh C Ketkar.

src/surf/network_ns3.cpp

index 1a704b8..b9f3b98 100644 (file)
@@ -349,7 +349,7 @@ void NetworkNS3Model::update_actions_state(double now, double delta)
       action->last_sent_ = sgFlow->sent_bytes_;
     }
 
-    if(sgFlow->finished_){
+    if ((sgFlow->finished_) && (remains <= 0)) { // finished_ should not become true before remains gets to 0, but it sometimes does. Let's play safe, here.
       socket_to_destroy.push_back(ns3_socket);
       XBT_DEBUG("Destroy socket %s of action %p", ns3_socket.c_str(), action);
       action->set_remains(0);