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
Container Registry
Model registry
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
The Tor Project
Core
Tor
Commits
0de26256
Commit
0de26256
authored
10 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'public/bug8387_diagnostic'
parents
2e1ac274
48b9c6fc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
changes/diagnose_8387
+4
-0
4 additions, 0 deletions
changes/diagnose_8387
src/or/circuituse.c
+58
-0
58 additions, 0 deletions
src/or/circuituse.c
src/or/circuituse.h
+1
-0
1 addition, 0 deletions
src/or/circuituse.h
src/or/status.c
+3
-0
3 additions, 0 deletions
src/or/status.c
with
66 additions
and
0 deletions
changes/diagnose_8387
0 → 100644
+
4
−
0
View file @
0de26256
o Minor features (diagnostic):
- When we log a heartbeat, log how many one-hop circuits we have that
are at least 30 minutes old, and log status information about a
few of them. This is an attempt to track down bug 8387.
This diff is collapsed.
Click to expand it.
src/or/circuituse.c
+
58
−
0
View file @
0de26256
...
...
@@ -783,6 +783,64 @@ circuit_expire_building(void)
}
}
/**
* As a diagnostic for bug 8387, log information about how many one-hop
* circuits we have around that have been there for at least <b>age</b>
* seconds. Log a few of them.
*/
void
circuit_log_ancient_one_hop_circuits
(
int
age
)
{
#define MAX_ANCIENT_ONEHOP_CIRCUITS_TO_LOG 10
time_t
cutoff
=
time
(
NULL
)
-
age
;
int
n_found
=
0
;
smartlist_t
*
log_these
=
smartlist_new
();
const
circuit_t
*
circ
;
TOR_LIST_FOREACH
(
circ
,
circuit_get_global_list
(),
head
)
{
const
origin_circuit_t
*
ocirc
;
if
(
!
CIRCUIT_IS_ORIGIN
(
circ
))
continue
;
if
(
circ
->
timestamp_created
.
tv_sec
>=
cutoff
)
continue
;
ocirc
=
CONST_TO_ORIGIN_CIRCUIT
(
circ
);
if
(
ocirc
->
build_state
&&
ocirc
->
build_state
->
onehop_tunnel
)
{
++
n_found
;
if
(
smartlist_len
(
log_these
)
<
MAX_ANCIENT_ONEHOP_CIRCUITS_TO_LOG
)
smartlist_add
(
log_these
,
(
origin_circuit_t
*
)
ocirc
);
}
}
if
(
n_found
==
0
)
goto
done
;
log_notice
(
LD_HEARTBEAT
,
"Diagnostic for issue 8387: Found %d one-hop circuits more "
"than %d seconds old! Logging %d..."
,
n_found
,
age
,
smartlist_len
(
log_these
));
SMARTLIST_FOREACH_BEGIN
(
log_these
,
const
origin_circuit_t
*
,
ocirc
)
{
char
created
[
ISO_TIME_LEN
+
1
];
circ
=
TO_CIRCUIT
(
ocirc
);
format_local_iso_time
(
created
,
circ
->
timestamp_created
.
tv_sec
);
log_notice
(
LD_HEARTBEAT
,
" #%d created at %s. %s, %s. %s for close. "
"%s for new conns."
,
ocirc_sl_idx
,
created
,
circuit_state_to_string
(
circ
->
state
),
circuit_purpose_to_string
(
circ
->
purpose
),
circ
->
marked_for_close
?
"Marked"
:
"Not marked"
,
ocirc
->
unusable_for_new_conns
?
"Not usable"
:
"usable"
);
}
SMARTLIST_FOREACH_END
(
ocirc
);
done:
smartlist_free
(
log_these
);
}
/** Remove any elements in <b>needed_ports</b> that are handled by an
* open or in-progress circuit.
*/
...
...
This diff is collapsed.
Click to expand it.
src/or/circuituse.h
+
1
−
0
View file @
0de26256
...
...
@@ -16,6 +16,7 @@ void circuit_expire_building(void);
void
circuit_remove_handled_ports
(
smartlist_t
*
needed_ports
);
int
circuit_stream_is_being_handled
(
entry_connection_t
*
conn
,
uint16_t
port
,
int
min
);
void
circuit_log_ancient_one_hop_circuits
(
int
age
);
#if 0
int circuit_conforms_to_options(const origin_circuit_t *circ,
const or_options_t *options);
...
...
This diff is collapsed.
Click to expand it.
src/or/status.c
+
3
−
0
View file @
0de26256
...
...
@@ -9,6 +9,7 @@
#define STATUS_PRIVATE
#include
"or.h"
#include
"circuituse.h"
#include
"config.h"
#include
"status.h"
#include
"nodelist.h"
...
...
@@ -135,6 +136,8 @@ log_heartbeat(time_t now)
if
(
public_server_mode
(
options
))
rep_hist_log_circuit_handshake_stats
(
now
);
circuit_log_ancient_one_hop_circuits
(
1800
);
tor_free
(
uptime
);
tor_free
(
bw_sent
);
tor_free
(
bw_rcvd
);
...
...
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