diff --git a/maestro/pool_client.c b/maestro/pool_client.c index a82b78eeff10f822cf3edeb1911754b90577d9cb..288a0aaa702662004eb66cb2d276af2102c45956 100644 --- a/maestro/pool_client.c +++ b/maestro/pool_client.c @@ -871,8 +871,17 @@ mstro_pc__app_befriend(mstro_pool_operation op) DEBUG("Unknown app %zu, let's make friends\n", appid); /* mark that this app entry is being read now for others */ status = mstro_pc_app_register_pending(appid); + /*check status */ + if(status == MSTRO_FAIL) + { + /* we could not put a pending entry, + * probably someone else was faster than us + * We should try this operation step again + * returning wouldblock so that op engine would retry later*/ + return MSTRO_WOULDBLOCK; + } + /**Submit read */ - /* we need to be careful to not pass in any stack-local refs */ Mstro__AppInfo *dst_epd=NULL; status=mstro_appinfo_deserialize(op->pc_transport.target_serialized_endpoint, &dst_epd); diff --git a/maestro/pool_manager_registry.c b/maestro/pool_manager_registry.c index b0d3d3b58c4579e8bfad6df628c6e6853d8d97c7..96eaecd54a17a84558f9897cb97cfe574ef669be 100644 --- a/maestro/pool_manager_registry.c +++ b/maestro/pool_manager_registry.c @@ -257,6 +257,7 @@ mstro_pc_app_register_pending(mstro_app_id id) /**check there is no other entry before*/ HASH_FIND(hh, g_mstro_pm_app_registry, &id, sizeof(mstro_app_id), elt); if((elt!=NULL) && (elt->pending)) { + //FIXME should be a warning as we can handle this ERR("There is alreading a pending entry for app %"PRIappid", should not overwrite \n", id); return MSTRO_FAIL; }