Navigation


Changeset 1279:a1685a53fe97 in freeDiameter


Ignore:
Timestamp:
Sep 12, 2014, 9:47:38 PM (10 years ago)
Author:
Thomas Klausner <tk@giga.or.at>
Branch:
default
Phase:
public
Message:

When requests fall into timeout, log them, the timeout, and the slow peer.

Fix a typo in a variable name while here.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/rt_busypeers/rtbusy.c

    r1127 r1279  
    5050        struct rt_data * rtd = NULL;
    5151        struct fd_list * candidates = NULL;
    52         int sendingattemtps;
     52        int sendingattempts;
    5353        int resend = 1;
    5454       
     
    7373                                    ER_DIAMETER_TOO_BUSY,
    7474                                    &candidates,
    75                                     &sendingattemtps) );
     75                                    &sendingattempts) );
    7676       
    7777        /* Now we need to decide if we re-send this query to a different peer or return an error to upstream */
     
    7979        /* First, are we exceeding the allowed attempts? */
    8080        if (rtbusy_conf.RetryMaxPeers != 0) {
    81                 if (sendingattemtps >= rtbusy_conf.RetryMaxPeers) {
     81                if (sendingattempts >= rtbusy_conf.RetryMaxPeers) {
    8282                        TRACE_DEBUG(FULL, "Maximum number of sending attempts reached for message %p, returning an error upstream", qry);
    8383                        resend = 0;
     
    107107                /* Send the query again. We  need to re-associate the expirecb which was cleaned, if it is used */
    108108                if (rtbusy_conf.RelayTimeout) {
     109                        char *buf = NULL;
     110                        size_t len;
    109111                        struct timespec expire;
    110112                        CHECK_SYS(  clock_gettime(CLOCK_REALTIME, &expire)  );
    111113                        expire.tv_sec += rtbusy_conf.RelayTimeout/1000 + ((expire.tv_nsec + (1000000LL * (rtbusy_conf.RelayTimeout % 1000))) / 1000000000LL);
    112114                        expire.tv_nsec = (expire.tv_nsec + (1000000LL * (rtbusy_conf.RelayTimeout % 1000))) % 1000000000LL;
     115                        CHECK_MALLOC_DO( fd_msg_dump_full(&buf, &len, NULL, *pmsg, fd_g_config->cnf_dict, 0, 1), /* nothing */);
     116                        TRACE_ERROR( "No answer received for message from peer '%.*s' before timeout (%dms), re-sending: %s", senttolen, sentto,
     117                                     rtbusy_conf.RelayTimeout, buf);
     118                        free(buf);
    113119                        CHECK_FCT( fd_msg_send_timeout( pmsg, NULL, NULL, rtbusy_expirecb, &expire ) );
    114120                } else {
     
    118124        } else {
    119125                if (is_req) {
     126                        char *buf = NULL;
     127                        size_t len;
     128
     129                        CHECK_MALLOC_DO( fd_msg_dump_full(&buf, &len, NULL, *pmsg, fd_g_config->cnf_dict, 0, 1), /* nothing */);
     130                        TRACE_ERROR( "No answer received for message from peer '%.*s' before timeout (%dms), giving up and sending error reply: %s", senttolen, sentto,
     131                                     rtbusy_conf.RelayTimeout, buf);
     132                        free(buf);
    120133                        /* We must create an answer */
    121134                        CHECK_FCT( fd_msg_new_answer_from_req ( fd_g_config->cnf_dict, pmsg, MSGFL_ANSW_ERROR ) );
Note: See TracChangeset for help on using the changeset viewer.