You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/09/22 09:07:20 UTC

[jira] [Work logged] (TS-4885) Incorrect checking of fds_throttle and fds_limit

     [ https://issues.apache.org/jira/browse/TS-4885?focusedWorklogId=29488&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-29488 ]

ASF GitHub Bot logged work on TS-4885:
--------------------------------------

                Author: ASF GitHub Bot
            Created on: 22/Sep/16 09:07
            Start Date: 22/Sep/16 09:07
    Worklog Time Spent: 10m 
      Work Description: GitHub user oknet opened a pull request:

    https://github.com/apache/trafficserver/pull/1040

    TS-4885: Correct the calculation of fds_throttle and fds_limit

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/oknet/trafficserver TS-4885

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/trafficserver/pull/1040.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1040
    
----
commit 98bdac00dabc39d168eeddf19755abc5160d4c33
Author: Oknet Xu <xu...@skyguard.com.cn>
Date:   2016-09-22T09:04:20Z

    TS-4885: Correct the calculation of fds_throttle and fds_limit

----


Issue Time Tracking
-------------------

            Worklog Id:     (was: 29488)
            Time Spent: 10m
    Remaining Estimate: 0h

> Incorrect checking of fds_throttle and fds_limit
> ------------------------------------------------
>
>                 Key: TS-4885
>                 URL: https://issues.apache.org/jira/browse/TS-4885
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: Core
>            Reporter: Oknet Xu
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> {code}
>  902 static void
>  903 check_fd_limit()
>  904 {
>  905   int fds_throttle = -1;
>  906   REC_ReadConfigInteger(fds_throttle, "proxy.config.net.connections_throttle");
>  907   if (fds_throttle > fds_limit + THROTTLE_FD_HEADROOM) {      // -------> Incorrect
>  908     int new_fds_throttle = fds_limit - THROTTLE_FD_HEADROOM;
>  909     if (new_fds_throttle < 1) {
>  910       ink_abort("too few file descriptors (%d) available", fds_limit);
>  911     }
>  912     char msg[256];
>  913     snprintf(msg, sizeof(msg), "connection throttle too high, "
>  914                                "%d (throttle) + %d (internal use) > %d (file descriptor limit), "
>  915                                "using throttle of %d",
>  916              fds_throttle, THROTTLE_FD_HEADROOM, fds_limit, new_fds_throttle);
>  917     SignalWarning(MGMT_SIGNAL_SYSTEM_ERROR, msg);
>  918   }
>  919 }
> {code}
> {code}
> 1001 static void
> 1002 adjust_sys_settings(void)
> 1003 {
> ...
> 1024   REC_ReadConfigInteger(fds_throttle, "proxy.config.net.connections_throttle");
> 1025 
> 1026   if (getrlimit(RLIMIT_NOFILE, &lim) == 0) {
> 1027     if (fds_throttle > (int)(lim.rlim_cur + THROTTLE_FD_HEADROOM)) {  // ------> Incorrect
> 1028       lim.rlim_cur = (lim.rlim_max = (rlim_t)fds_throttle);
> 1029       if (setrlimit(RLIMIT_NOFILE, &lim) == 0 && getrlimit(RLIMIT_NOFILE, &lim) == 0) {
> 1030         fds_limit = (int)lim.rlim_cur;
> 1031         syslog(LOG_NOTICE, "NOTE: RLIMIT_NOFILE(%d):cur(%d),max(%d)", RLIMIT_NOFILE, (int)lim.rlim_cur, (int)lim.rlim_max);
> 1032       }
> 1033     }
> 1034   }
> ...
> 1043 }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)