TransWikia.com

Tor client node ignores `set_config` from Stem

Tor Asked by vanbastelaer on September 28, 2021

I was doing some experiments for a project on a Tor test network. I used Chutney to set up a small network and Stem to control one of the client nodes in the network. Because I made some changes on a relay node, I wanted to set up a circuit containing that node and run some quick experiments. My changes made the relay node run much slower, so I also need to change some default timeout settings.

I used the following code to set up a new circuit:

circuit_id = controller.new_circuit(path=["test009r", "test008r"], purpose='general', await_build=True)

The new circuit contains two relay nodes. I made some changes on the test009r node.
Circuit building failed at runtime because:

Circuit failed to be created: CHANNEL_CLOSED

I believe it was because of some timeout, so I configured the client node:

controller.set_conf("MaxCircuitDirtiness", "60000")
controller.set_conf("LearnCircuitBuildTimeout", "0")
controller.set_conf("CircuitBuildTimeout", "60000")
controller.set_conf("CircuitStreamTimeout", "60000")

I tried to set large timeout windows, but it seemed like Tor just ignored them, because I still got the same error.
I also tried:

controller.signal(stem.Signal.HUP)

after set_conf to "refresh" the configuration of the client node.
When running controller.get_conf_map, I was able to confirm that those configurations did change.
This part of the info.log might be relevant:

Jul 16 22:29:55.295 [info] circuit_build_times_set_timeout(): Set buildtimeout to low value 485.535223ms. Setting to 1500ms
Jul 16 22:29:55.417 [info] circuit_build_times_set_timeout(): Based on 164 circuit times, it looks like we don't need to wait so long for circuits to finish. We will now assume a circuit is too slow to use after waiting 2 seconds.
Jul 16 22:29:55.428 [info] circuit_build_times_set_timeout(): Circuit timeout data: 1500.000000ms, 60000.000000ms, Xm: 75, a: 0.861692, r: 0.170732
Jul 16 22:29:55.522 [info] circuit_build_times_filter_timeouts(): We had 28 timeouts out of 164 build times, and filtered 0 above the max of 60000

But I am not sure how to parse them. For example, from Tor’s documentation, 60000 should be in seconds, but not ms?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP