Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Benjamin J. Thompson
Tor
Commits
a25d97e5
Commit
a25d97e5
authored
7 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Plain Diff
Merge branch 'teor-bug22797-025' into maint-0.2.9
parents
3cace828
878e0d45
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changes/bug22797
+4
-0
4 additions, 0 deletions
changes/bug22797
src/common/compat.c
+12
-7
12 additions, 7 deletions
src/common/compat.c
with
16 additions
and
7 deletions
changes/bug22797
0 → 100644
+
4
−
0
View file @
a25d97e5
o Minor bugfixes (file limits):
- When setting the maximum number of connections allowed by the OS,
always allow some extra file descriptors for other files.
Fixes bug 22797; bugfix on 0.2.0.10-alpha.
This diff is collapsed.
Click to expand it.
src/common/compat.c
+
12
−
7
View file @
a25d97e5
...
...
@@ -1718,19 +1718,24 @@ set_max_file_descriptors(rlim_t limit, int *max_out)
if
(
setrlimit
(
RLIMIT_NOFILE
,
&
rlim
)
!=
0
)
{
int
bad
=
1
;
#ifdef OPEN_MAX
if
(
errno
==
EINVAL
&&
OPEN_MAX
<
rlim
.
rlim_cur
)
{
uint64_t
try_limit
=
OPEN_MAX
-
ULIMIT_BUFFER
;
if
(
errno
==
EINVAL
&&
try_limit
<
rlim
.
rlim_cur
)
{
/* On some platforms, OPEN_MAX is the real limit, and getrlimit() is
* full of nasty lies. I'm looking at you, OSX 10.5.... */
rlim
.
rlim_cur
=
OPEN_MAX
;
rlim
.
rlim_cur
=
try_limit
;
if
(
setrlimit
(
RLIMIT_NOFILE
,
&
rlim
)
==
0
)
{
if
(
rlim
.
rlim_cur
<
(
rlim_t
)
limit
)
{
log_warn
(
LD_CONFIG
,
"We are limited to %lu file descriptors by "
"OPEN_MAX, and ConnLimit is %lu. Changing ConnLimit; sorry."
,
(
unsigned
long
)
OPEN_MAX
,
(
unsigned
long
)
limit
);
"OPEN_MAX (%lu), and ConnLimit is %lu. Changing "
"ConnLimit; sorry."
,
(
unsigned
long
)
try_limit
,
(
unsigned
long
)
OPEN_MAX
,
(
unsigned
long
)
limit
);
}
else
{
log_info
(
LD_CONFIG
,
"Dropped connection limit to OPEN_MAX (%lu); "
"Apparently, %lu was too high and rlimit lied to us."
,
(
unsigned
long
)
OPEN_MAX
,
(
unsigned
long
)
rlim
.
rlim_max
);
log_info
(
LD_CONFIG
,
"Dropped connection limit to %lu based on "
"OPEN_MAX (%lu); Apparently, %lu was too high and rlimit "
"lied to us."
,
(
unsigned
long
)
try_limit
,
(
unsigned
long
)
OPEN_MAX
,
(
unsigned
long
)
rlim
.
rlim_max
);
}
bad
=
0
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment