Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/buffer_client.cpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/buffer_client.cpp	(revision 2323)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/buffer_client.cpp	(revision 2324)
@@ -144,4 +144,5 @@
     if (hasWindows)
     {
+      if (winState[current]==true) ERROR("CClientBuffer::lockBuffer(void)",<<"Try lo lock client buffer but winState said it is already locked") ;
       MPI_Win_lock(MPI_LOCK_EXCLUSIVE,clientRank_, 0, windows_[current]) ;
       winState[current]=true ;
@@ -155,4 +156,5 @@
     if (hasWindows)
     {
+      if (winState[current]==false) ERROR("CClientBuffer::lockBuffer(void)",<<"Try lo unlock client buffer but winState said it is already unlocked") ;
       MPI_Win_unlock(clientRank_, windows_[current]) ;
       winState[current]=false ;
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/context_client.cpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/context_client.cpp	(revision 2323)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/context_client.cpp	(revision 2324)
@@ -175,8 +175,8 @@
       if (isAttachedModeEnabled()) // couldBuffer is always true in attached mode
       {
-        while (checkBuffers(ranks)) context_->globalEventLoop() ;
+        while (checkBuffers(ranks)) callGlobalEventLoop() ;
       
         CXios::getDaemonsManager()->scheduleContext(hashId_) ;
-        while (CXios::getDaemonsManager()->isScheduledContext(hashId_)) context_->globalEventLoop() ;
+        while (CXios::getDaemonsManager()->isScheduledContext(hashId_)) callGlobalEventLoop() ;
       }
       
@@ -287,5 +287,5 @@
           checkBuffers();
 
-          context_->globalEventLoop() ;
+          callGlobalEventLoop() ;
         }
 
@@ -301,4 +301,15 @@
    }
 
+   void CContextClient::eventLoop(void)
+   {
+      if (!locked_) checkBuffers() ;
+   }
+
+   void CContextClient::callGlobalEventLoop(void)
+   {
+     locked_=true ;
+     context_->globalEventLoop() ;
+     locked_=false ;
+   }
    /*!
    Make a new buffer for a certain connection to server with specific rank
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/context_client.hpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/context_client.hpp	(revision 2323)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/context_client.hpp	(revision 2324)
@@ -39,4 +39,6 @@
       bool checkBuffers(list<int>& ranks);
       bool checkBuffers(void);
+      void eventLoop(void) ;
+      void callGlobalEventLoop() ;
       void releaseBuffers(void);
       bool havePendingRequests(void);
@@ -129,4 +131,6 @@
 
       double latency_=0e-2 ;
+
+      bool locked_ = false ; //!< The context client is locked to avoid recursive checkBuffer
   };
 }
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.cpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.cpp	(revision 2323)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.cpp	(revision 2324)
@@ -684,17 +684,17 @@
     setCurrent(getId()) ;
 
-    if (client!=nullptr && !finalized) client->checkBuffers();
+    if (client!=nullptr && !finalized) client->eventLoop();
     
     for (int i = 0; i < clientPrimServer.size(); ++i)
     {
-      if (!finalized) clientPrimServer[i]->checkBuffers();
+      if (!finalized) clientPrimServer[i]->eventLoop();
       if (!finalized) finished &= serverPrimServer[i]->eventLoop(enableEventsProcessing);
     }
 
     for (auto couplerOut : couplerOutClient_)
-      if (!finalized) couplerOut.second->checkBuffers();
+      if (!finalized) couplerOut.second->eventLoop();
     
     for (auto couplerIn : couplerInClient_)
-      if (!finalized) couplerIn.second->checkBuffers();
+      if (!finalized) couplerIn.second->eventLoop();
     
     for (auto couplerOut : couplerOutServer_)
@@ -788,5 +788,5 @@
         client->finalize();
         info(100)<<"DEBUG: context "<<getId()<<" Client finalize sent"<<endl ;
-        while (client->havePendingRequests()) client->checkBuffers();
+        while (client->havePendingRequests()) client->eventLoop();
         info(100)<<"DEBUG: context "<<getId()<<" no pending request ok"<<endl ;
         bool notifiedFinalized=false ;
@@ -808,5 +808,5 @@
            do
            {
-             clientPrimServer[i]->checkBuffers();
+             clientPrimServer[i]->eventLoop();
              bufferReleased = !clientPrimServer[i]->havePendingRequests();
            } while (!bufferReleased);
@@ -1099,5 +1099,4 @@
     {
       for(auto field : fileOutField) slaveServers_.insert(field->getContextClient()) ; 
-      for(auto field : fileInField)  slaveServers_.insert(field->getContextClient()) ;  
     }
 
@@ -1709,7 +1708,7 @@
    TRY
    {
-     CEventClient event(getType(),EVENT_ID_UPDATE_CALENDAR);
      for(auto client : slaveServers_) 
      {
+       CEventClient event(getType(),EVENT_ID_UPDATE_CALENDAR);
        if (client->isServerLeader())
        {
