@@ -966,92 +966,84 @@ static void _commitfn(int sd, short args, void *cbdata)
966966 if (pmix_globals .commits_pending ) {
967967 /* fetch and pack the local values */
968968 scope = PMIX_LOCAL ;
969- PMIX_BFROPS_PACK (rc , pmix_client_globals .myserver ,
970- msgout , & scope , 1 , PMIX_SCOPE );
971- if (PMIX_SUCCESS != rc ) {
972- PMIX_ERROR_LOG (rc );
973- PMIX_RELEASE (msgout );
974- goto error ;
975- }
976969 /* allow the GDS module to pass us this info
977970 * as a local connection as this data would
978971 * only go to another local client */
979972 cb -> proc = & pmix_globals .myid ;
980973 cb -> scope = scope ;
981974 cb -> copy = false;
982975 PMIX_GDS_FETCH_KV (rc , pmix_globals .mypeer , cb );
983- if (PMIX_SUCCESS != rc ) {
984- PMIX_ERROR_LOG (rc );
985- PMIX_RELEASE (msgout );
986- goto error ;
987- }
988-
989- PMIX_CONSTRUCT (& bkt , pmix_buffer_t );
990- PMIX_LIST_FOREACH_SAFE (kv , kvn , & cb -> kvs , pmix_kval_t ) {
976+ if (PMIX_SUCCESS == rc ) {
991977 PMIX_BFROPS_PACK (rc , pmix_client_globals .myserver ,
992- & bkt , kv , 1 , PMIX_KVAL );
978+ msgout , & scope , 1 , PMIX_SCOPE );
979+ if (PMIX_SUCCESS != rc ) {
980+ PMIX_ERROR_LOG (rc );
981+ PMIX_RELEASE (msgout );
982+ goto error ;
983+ }
984+ PMIX_CONSTRUCT (& bkt , pmix_buffer_t );
985+ PMIX_LIST_FOREACH_SAFE (kv , kvn , & cb -> kvs , pmix_kval_t ) {
986+ PMIX_BFROPS_PACK (rc , pmix_client_globals .myserver ,
987+ & bkt , kv , 1 , PMIX_KVAL );
988+ if (PMIX_SUCCESS != rc ) {
989+ PMIX_ERROR_LOG (rc );
990+ PMIX_DESTRUCT (& bkt );
991+ PMIX_RELEASE (msgout );
992+ goto error ;
993+ }
994+ pmix_list_remove_item (& cb -> kvs , & kv -> super );
995+ PMIX_RELEASE (kv );
996+ }
997+ /* now pack the result */
998+ PMIX_BFROPS_PACK (rc , pmix_client_globals .myserver ,
999+ msgout , & bkt , 1 , PMIX_BUFFER );
1000+ PMIX_DESTRUCT (& bkt );
9931001 if (PMIX_SUCCESS != rc ) {
9941002 PMIX_ERROR_LOG (rc );
995- PMIX_DESTRUCT (& bkt );
9961003 PMIX_RELEASE (msgout );
9971004 goto error ;
9981005 }
999- pmix_list_remove_item (& cb -> kvs , & kv -> super );
1000- PMIX_RELEASE (kv );
1001- }
1002- /* now pack the result */
1003- PMIX_BFROPS_PACK (rc , pmix_client_globals .myserver ,
1004- msgout , & bkt , 1 , PMIX_BUFFER );
1005- PMIX_DESTRUCT (& bkt );
1006- if (PMIX_SUCCESS != rc ) {
1007- PMIX_ERROR_LOG (rc );
1008- PMIX_RELEASE (msgout );
1009- goto error ;
10101006 }
10111007
10121008 /* fetch and pack the remote values */
10131009 scope = PMIX_REMOTE ;
1014- PMIX_BFROPS_PACK (rc , pmix_client_globals .myserver ,
1015- msgout , & scope , 1 , PMIX_SCOPE );
1016- if (PMIX_SUCCESS != rc ) {
1017- PMIX_ERROR_LOG (rc );
1018- PMIX_RELEASE (msgout );
1019- goto error ;
1020- }
10211010 /* we need real copies here as this data will
10221011 * go to remote procs - so a connection will
10231012 * not suffice */
10241013 cb -> proc = & pmix_globals .myid ;
10251014 cb -> scope = scope ;
10261015 cb -> copy = true;
10271016 PMIX_GDS_FETCH_KV (rc , pmix_globals .mypeer , cb );
1028- if (PMIX_SUCCESS != rc ) {
1029- PMIX_ERROR_LOG (rc );
1030- PMIX_RELEASE (msgout );
1031- goto error ;
1032- }
1033-
1034- PMIX_CONSTRUCT (& bkt , pmix_buffer_t );
1035- PMIX_LIST_FOREACH_SAFE (kv , kvn , & cb -> kvs , pmix_kval_t ) {
1017+ if (PMIX_SUCCESS == rc ) {
10361018 PMIX_BFROPS_PACK (rc , pmix_client_globals .myserver ,
1037- & bkt , kv , 1 , PMIX_KVAL );
1019+ msgout , & scope , 1 , PMIX_SCOPE );
1020+ if (PMIX_SUCCESS != rc ) {
1021+ PMIX_ERROR_LOG (rc );
1022+ PMIX_RELEASE (msgout );
1023+ goto error ;
1024+ }
1025+ PMIX_CONSTRUCT (& bkt , pmix_buffer_t );
1026+ PMIX_LIST_FOREACH_SAFE (kv , kvn , & cb -> kvs , pmix_kval_t ) {
1027+ PMIX_BFROPS_PACK (rc , pmix_client_globals .myserver ,
1028+ & bkt , kv , 1 , PMIX_KVAL );
1029+ if (PMIX_SUCCESS != rc ) {
1030+ PMIX_ERROR_LOG (rc );
1031+ PMIX_DESTRUCT (& bkt );
1032+ PMIX_RELEASE (msgout );
1033+ goto error ;
1034+ }
1035+ pmix_list_remove_item (& cb -> kvs , & kv -> super );
1036+ PMIX_RELEASE (kv );
1037+ }
1038+ /* now pack the result */
1039+ PMIX_BFROPS_PACK (rc , pmix_client_globals .myserver ,
1040+ msgout , & bkt , 1 , PMIX_BUFFER );
1041+ PMIX_DESTRUCT (& bkt );
10381042 if (PMIX_SUCCESS != rc ) {
10391043 PMIX_ERROR_LOG (rc );
1040- PMIX_DESTRUCT (& bkt );
10411044 PMIX_RELEASE (msgout );
10421045 goto error ;
10431046 }
1044- pmix_list_remove_item (& cb -> kvs , & kv -> super );
1045- PMIX_RELEASE (kv );
1046- }
1047- /* now pack the result */
1048- PMIX_BFROPS_PACK (rc , pmix_client_globals .myserver ,
1049- msgout , & bkt , 1 , PMIX_BUFFER );
1050- PMIX_DESTRUCT (& bkt );
1051- if (PMIX_SUCCESS != rc ) {
1052- PMIX_ERROR_LOG (rc );
1053- PMIX_RELEASE (msgout );
1054- goto error ;
10551047 }
10561048
10571049 /* record that all committed data to-date has been sent */
0 commit comments