Print this page
4463 NLM fails wrongly on clnt_control().


 133         int ret;
 134 
 135         if (rpcp->nr_handle == NULL) {
 136                 bool_t clset = TRUE;
 137 
 138                 ret = clnt_tli_kcreate(&hostp->nh_knc, &hostp->nh_addr,
 139                     NLM_PROG, rpcp->nr_vers, 0, NLM_RPC_RETRIES,
 140                     CRED(), &rpcp->nr_handle);
 141 
 142                 /*
 143                  * Set the client's CLSET_NODELAYONERR option to true. The
 144                  * RPC clnt_call interface creates an artificial delay for
 145                  * certain call errors in order to prevent RPC consumers
 146                  * from getting into tight retry loops. Since this function is
 147                  * called by the NLM service routines we would like to avoid
 148                  * this artificial delay when possible. We do not retry if the
 149                  * NULL request fails so it is safe for us to turn this option
 150                  * on.
 151                  */
 152                 if (clnt_control(rpcp->nr_handle, CLSET_NODELAYONERR,
 153                     (char *)&clset)) {
 154                         NLM_ERR("Unable to set CLSET_NODELAYONERR\n");
 155                 }
 156         } else {
 157                 ret = clnt_tli_kinit(rpcp->nr_handle, &hostp->nh_knc,
 158                     &hostp->nh_addr, 0, NLM_RPC_RETRIES, CRED());
 159                 if (ret == 0) {
 160                         enum clnt_stat stat;
 161 
 162                         /*
 163                          * Check whether host's RPC binding is still
 164                          * fresh, i.e. if remote program is still sits
 165                          * on the same port we assume. Call NULL proc
 166                          * to do it.
 167                          *
 168                          * Note: Even though we set no delay on error on the
 169                          * client handle the call to nlm_null_rpc can still
 170                          * delay for 10 seconds before returning an error. For
 171                          * example the no delay on error option is not honored
 172                          * for RPC_XPRTFAILED errors (see clnt_cots_kcallit).
 173                          */




 133         int ret;
 134 
 135         if (rpcp->nr_handle == NULL) {
 136                 bool_t clset = TRUE;
 137 
 138                 ret = clnt_tli_kcreate(&hostp->nh_knc, &hostp->nh_addr,
 139                     NLM_PROG, rpcp->nr_vers, 0, NLM_RPC_RETRIES,
 140                     CRED(), &rpcp->nr_handle);
 141 
 142                 /*
 143                  * Set the client's CLSET_NODELAYONERR option to true. The
 144                  * RPC clnt_call interface creates an artificial delay for
 145                  * certain call errors in order to prevent RPC consumers
 146                  * from getting into tight retry loops. Since this function is
 147                  * called by the NLM service routines we would like to avoid
 148                  * this artificial delay when possible. We do not retry if the
 149                  * NULL request fails so it is safe for us to turn this option
 150                  * on.
 151                  */
 152                 if (clnt_control(rpcp->nr_handle, CLSET_NODELAYONERR,
 153                     (char *)&clset) == FALSE) {
 154                         NLM_ERR("Unable to set CLSET_NODELAYONERR\n");
 155                 }
 156         } else {
 157                 ret = clnt_tli_kinit(rpcp->nr_handle, &hostp->nh_knc,
 158                     &hostp->nh_addr, 0, NLM_RPC_RETRIES, CRED());
 159                 if (ret == 0) {
 160                         enum clnt_stat stat;
 161 
 162                         /*
 163                          * Check whether host's RPC binding is still
 164                          * fresh, i.e. if remote program is still sits
 165                          * on the same port we assume. Call NULL proc
 166                          * to do it.
 167                          *
 168                          * Note: Even though we set no delay on error on the
 169                          * client handle the call to nlm_null_rpc can still
 170                          * delay for 10 seconds before returning an error. For
 171                          * example the no delay on error option is not honored
 172                          * for RPC_XPRTFAILED errors (see clnt_cots_kcallit).
 173                          */