Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
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
Gedsh
Tor
Commits
e3ad41e7
Commit
e3ad41e7
authored
1 year ago
by
Mike Perry
Browse files
Options
Downloads
Patches
Plain Diff
Bug 40827: Add additional logs and checks for 0-leg conflux case
parent
5487476f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/core/or/conflux.c
+19
-4
19 additions, 4 deletions
src/core/or/conflux.c
src/core/or/relay.c
+18
-0
18 additions, 0 deletions
src/core/or/relay.c
with
37 additions
and
4 deletions
src/core/or/conflux.c
+
19
−
4
View file @
e3ad41e7
...
...
@@ -536,7 +536,7 @@ conflux_note_cell_sent(conflux_t *cfx, circuit_t *circ, uint8_t relay_command)
/** Find the leg with lowest non-zero curr_rtt_usec, and
* pick it for our current leg. */
static
inline
void
static
inline
bool
conflux_pick_first_leg
(
conflux_t
*
cfx
)
{
conflux_leg_t
*
min_leg
=
NULL
;
...
...
@@ -555,8 +555,20 @@ conflux_pick_first_leg(conflux_t *cfx)
}
CONFLUX_FOR_EACH_LEG_END
(
leg
);
if
(
!
min_leg
)
{
// Get the 0th leg; if it does not exist, assert
tor_assert
(
smartlist_len
(
cfx
->
legs
)
>
0
);
// Get the 0th leg; if it does not exist, log the set.
// Bug 40827 managed to hit this, so let's dump the sets
// in case it happens again.
if
(
BUG
(
smartlist_len
(
cfx
->
legs
)
<=
0
))
{
// Since we have no legs, we have no idea if this is really a client
// or server set. Try to find any that match:
log_warn
(
LD_BUG
,
"Matching client sets:"
);
conflux_log_set
(
cfx
,
true
);
log_warn
(
LD_BUG
,
"Matching server sets:"
);
conflux_log_set
(
cfx
,
false
);
log_warn
(
LD_BUG
,
"End conflux set dump"
);
return
false
;
}
min_leg
=
smartlist_get
(
cfx
->
legs
,
0
);
tor_assert
(
min_leg
);
if
(
BUG
(
min_leg
->
linked_sent_usec
==
0
))
{
...
...
@@ -572,6 +584,8 @@ conflux_pick_first_leg(conflux_t *cfx)
cfx
->
cells_until_switch
=
0
;
cfx
->
curr_leg
=
min_leg
;
return
true
;
}
/**
...
...
@@ -589,7 +603,8 @@ conflux_decide_next_circ(conflux_t *cfx)
/* If we don't have a current leg yet, pick one.
* (This is the only non-const operation in this function). */
if
(
!
cfx
->
curr_leg
)
{
conflux_pick_first_leg
(
cfx
);
if
(
!
conflux_pick_first_leg
(
cfx
))
return
NULL
;
}
/* First, check if we can switch. */
...
...
This diff is collapsed.
Click to expand it.
src/core/or/relay.c
+
18
−
0
View file @
e3ad41e7
...
...
@@ -2352,6 +2352,24 @@ connection_edge_package_raw_inbuf(edge_connection_t *conn, int package_partial,
return
-
1
;
}
// Bug 40827: With conflux, we suspect marked circuits were getting here.
// We think we fixed it, but let's add a check and log sets if it still
// happens.
if
(
BUG
(
circ
->
marked_for_close
))
{
log_warn
(
LD_BUG
,
"called on circ that's already marked for close at %s:%d."
,
circ
->
marked_for_close_file
,
circ
->
marked_for_close
);
if
(
CIRCUIT_IS_CONFLUX
(
circ
))
{
if
(
circ
->
conflux
)
{
conflux_log_set
(
circ
->
conflux
,
CIRCUIT_IS_ORIGIN
(
circ
));
}
else
{
log_warn
(
LD_BUG
,
" - circ is unlinked conflux"
);
}
}
conn
->
end_reason
=
END_STREAM_REASON_INTERNAL
;
return
-
1
;
}
if
(
circuit_consider_stop_edge_reading
(
circ
,
cpath_layer
))
return
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