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
5fa7c1b1
Unverified
Commit
5fa7c1b1
authored
5 years ago
by
teor
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'tor-github/pr/1661'
parents
d430b5a0
165a92e3
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/log_32868
+4
-0
4 additions, 0 deletions
changes/log_32868
src/feature/nodelist/node_select.c
+50
-4
50 additions, 4 deletions
src/feature/nodelist/node_select.c
with
54 additions
and
4 deletions
changes/log_32868
0 → 100644
+
4
−
0
View file @
5fa7c1b1
o Minor features (debugging, directory system):
- Don't crash when we find a non-guard with a guard-fraction value set.
Instead, log a bug warning, in an attempt to figure out how this
happened. Diagnostic for ticket 32868.
This diff is collapsed.
Click to expand it.
src/feature/nodelist/node_select.c
+
50
−
4
View file @
5fa7c1b1
...
...
@@ -541,6 +541,51 @@ bridge_get_advertised_bandwidth_bounded(routerinfo_t *router)
return
result
;
}
/**
* We have found an instance of bug 32868: log our best guess about where the
* routerstatus was found.
**/
static
void
log_buggy_rs_source
(
const
routerstatus_t
*
rs
)
{
static
ratelim_t
buggy_rs_ratelim
=
RATELIM_INIT
(
1200
);
char
*
m
;
if
((
m
=
rate_limit_log
(
&
buggy_rs_ratelim
,
approx_time
())))
{
log_warn
(
LD_BUG
,
"Found a routerstatus %p with has_guardfraction=%u "
" and guardfraction_percentage=%u, but is_possible_guard=%u.%s"
,
rs
,
rs
->
has_guardfraction
,
rs
->
guardfraction_percentage
,
rs
->
is_possible_guard
,
m
);
tor_free
(
m
);
networkstatus_t
*
ns
;
int
in_ns_count
=
0
;
if
((
ns
=
networkstatus_get_latest_consensus_by_flavor
(
FLAV_NS
)))
{
int
pos
=
smartlist_pos
(
ns
->
routerstatus_list
,
rs
);
if
(
pos
>=
0
)
{
++
in_ns_count
;
log_warn
(
LD_BUG
,
"Found the routerstatus at position %d of the "
"NS consensus."
,
pos
);
}
}
if
((
ns
=
networkstatus_get_latest_consensus_by_flavor
(
FLAV_MICRODESC
)))
{
int
pos
=
smartlist_pos
(
ns
->
routerstatus_list
,
rs
);
if
(
pos
>=
0
)
{
++
in_ns_count
;
log_warn
(
LD_BUG
,
"Found the routerstatus at position %d of the "
"MD consensus."
,
pos
);
}
}
if
(
in_ns_count
==
0
)
{
log_warn
(
LD_BUG
,
"Could not find the routerstatus in any "
"latest consensus."
);
}
tor_assert_nonfatal_unreached
();
}
}
/** Given a list of routers and a weighting rule as in
* smartlist_choose_node_by_bandwidth_weights, compute weighted bandwidth
* values for each node and store them in a freshly allocated
...
...
@@ -717,10 +762,11 @@ compute_weighted_bandwidths(const smartlist_t *sl,
* choose N proportionally to F*Wpf*B + (1-F)*Wpn*B.
*/
if
(
node
->
rs
&&
node
->
rs
->
has_guardfraction
&&
rule
!=
WEIGHT_FOR_GUARD
)
{
/* XXX The assert should actually check for is_guard. However,
* that crashes dirauths because of #13297. This should be
* equivalent: */
tor_assert
(
node
->
rs
->
is_possible_guard
);
/* We should only have guardfraction set if the node has the Guard
flag. */
if
(
!
node
->
rs
->
is_possible_guard
)
{
log_buggy_rs_source
(
node
->
rs
);
}
guard_get_guardfraction_bandwidth
(
&
guardfraction_bw
,
this_bw
,
...
...
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