Opened 8 months ago

Closed 7 months ago

Last modified 7 months ago

#27996 closed defect (fixed)

Apparent race condition when recalculating relay priority

Reported by: pastly Owned by:
Priority: Medium Milestone: sbws: 1.0.x-final
Component: Core Tor/sbws Version:
Severity: Normal Keywords: sbws-1.0-must-closed-moved-20181128
Cc: pastly, juga, teor Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

This causes sbws scanner to crash completely.

This might be the time to look into a better priority queue. Or maybe re-evaluate my reasoning for making a copy of all relays instead of giving them a priority attribute.

Traceback:

Traceback (most recent call last):
  File "/home/matt/src/simple-bw-scanner/venv-editable/bin/sbws", line 11, in <module>
    load_entry_point('sbws', 'console_scripts', 'sbws')()
  File "/home/matt/src/simple-bw-scanner/sbws/sbws.py", line 75, in main
    exit(comm['f'](*comm['a'], **comm['kw']))
  File "/home/matt/src/simple-bw-scanner/sbws/core/scanner.py", line 387, in main
    run_speedtest(args, conf)
  File "/home/matt/src/simple-bw-scanner/sbws/core/scanner.py", line 347, in run_speedtest
    for target in rp.best_priority():
  File "/home/matt/src/simple-bw-scanner/sbws/lib/relayprioritizer.py", line 49, in best_priority
    relays = set(copy.deepcopy(self.relay_list.relays))
  File "/home/matt/src/simple-bw-scanner/venv-editable/lib/python3.5/copy.py", line 155, in deepcopy
    y = copier(x, memo)
  File "/home/matt/src/simple-bw-scanner/venv-editable/lib/python3.5/copy.py", line 218, in _deepcopy_list
    y.append(deepcopy(a, memo))
  File "/home/matt/src/simple-bw-scanner/venv-editable/lib/python3.5/copy.py", line 182, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
  File "/home/matt/src/simple-bw-scanner/venv-editable/lib/python3.5/copy.py", line 297, in _reconstruct
    state = deepcopy(state, memo)
  File "/home/matt/src/simple-bw-scanner/venv-editable/lib/python3.5/copy.py", line 155, in deepcopy
    y = copier(x, memo)
  File "/home/matt/src/simple-bw-scanner/venv-editable/lib/python3.5/copy.py", line 243, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/home/matt/src/simple-bw-scanner/venv-editable/lib/python3.5/copy.py", line 182, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
  File "/home/matt/src/simple-bw-scanner/venv-editable/lib/python3.5/copy.py", line 297, in _reconstruct
    state = deepcopy(state, memo)
  File "/home/matt/src/simple-bw-scanner/venv-editable/lib/python3.5/copy.py", line 155, in deepcopy
    y = copier(x, memo)
  File "/home/matt/src/simple-bw-scanner/venv-editable/lib/python3.5/copy.py", line 242, in _deepcopy_dict
    for key, value in x.items():
RuntimeError: dictionary changed size during iteration

Child Tickets

Change History (5)

comment:1 Changed 8 months ago by juga

Have you updated the code version without stopping, installing and starting again?.

I used to have that problem, and now it has been running for 1 month and half without it, so got to think that since i was installing it with -e, the, .pyc were changing on runtime, and dictionary memory changing, though not sure that's even possible...

How frequently it happens?, any way to reproduce it?

comment:2 Changed 8 months ago by pastly

How frequently it happens?, any way to reproduce it?

I just started running sbws again after not running it for months. It happened over the first night from what I can tell.

I don't know how to reproduce.

Have you updated the code version without stopping, installing and starting again?.

I used to have that problem, and now it has been running for 1 month and half without it, so got to think that since i was installing it with -e, the, .pyc were changing on runtime, and dictionary memory changing, though not sure that's even possible...

Interesting theory. I'll do a clean install and try again.

comment:4 Changed 7 months ago by teor

Milestone: sbws 1.0 (MVP must)
Resolution: fixed
Status: newclosed

We think this was fixed in another ticket.

comment:5 Changed 7 months ago by teor

Keywords: sbws-1.0-must-closed-moved-20181128 added
Milestone: sbws 1.0 (MVP must)sbws: 1.0.x-final

Move all closed sbws 1.0 must tickets to sbws 1.0.x-final

Note: See TracTickets for help on using tickets.