Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sbws
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
Releases
Container Registry
Model registry
Operate
Environments
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
juga
sbws
Commits
b9bc234e
Commit
b9bc234e
authored
6 years ago
by
juga
Browse files
Options
Downloads
Patches
Plain Diff
Recover code lost on merge bug28932
Merge:
8dbe8905
. Coded introduced in
a550d731
and
5dae9b99
.
parent
a1926b88
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sbws/core/scanner.py
+9
-5
9 additions, 5 deletions
sbws/core/scanner.py
with
9 additions
and
5 deletions
sbws/core/scanner.py
+
9
−
5
View file @
b9bc234e
...
...
@@ -14,7 +14,7 @@ from ..lib.relayprioritizer import RelayPrioritizer
from
..lib.destination
import
DestinationList
from
..util.timestamp
import
now_isodt_str
from
..util.state
import
State
from
sbws.globals
import
fail_hard
,
HTTP_GET_HEADERS
from
sbws.globals
import
fail_hard
,
HTTP_GET_HEADERS
,
TIMEOUT_MEASUREMENTS
import
sbws.util.stem
as
stem_utils
import
sbws.util.requests
as
requests_utils
from
argparse
import
ArgumentDefaultsHelpFormatter
...
...
@@ -456,12 +456,16 @@ def main_loop(args, conf, controller, relay_list, circuit_builder, result_dump,
# sleep is non-blocking since happens in the main process.
time
.
sleep
(
time_to_sleep
)
pending_results
=
[
r
for
r
in
pending_results
if
not
r
.
ready
()]
while
len
(
pending_results
)
>
0
:
log
.
debug
(
"
There are %s pending measurements.
"
,
len
(
pending_results
))
# sleep is non-blocking since happens in the main process.
time_waiting
=
0
while
(
len
(
pending_results
)
>
0
and
time_waiting
<=
TIMEOUT_MEASUREMENTS
):
log
.
debug
(
"
Number of pending measurement threads %s after
"
"
a prioritization loop.
"
,
len
(
pending_results
))
time
.
sleep
(
time_to_sleep
)
time_waiting
+=
time_to_sleep
pending_results
=
[
r
for
r
in
pending_results
if
not
r
.
ready
()]
if
time_waiting
>
TIMEOUT_MEASUREMENTS
:
dumpstacks
()
loop_tstop
=
time
.
time
()
loop_tdelta
=
(
loop_tstop
-
loop_tstart
)
/
60
log
.
debug
(
"
Measured %s relays in %s minutes
"
,
num_relays
,
loop_tdelta
)
...
...
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