Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conf_changed can happen before bootstrap #288

Open
meejah opened this issue Mar 22, 2018 · 5 comments
Open

conf_changed can happen before bootstrap #288

meejah opened this issue Mar 22, 2018 · 5 comments

Comments

@meejah
Copy link
Owner

meejah commented Mar 22, 2018

While its still reading the config, it looks like TorConfig can get CONF_CHANGED events (and probably does bad things). It should ignore CONF_CHANGED until after bootstrap is completed.

See TheTorProject/bwscanner@ccddac6#diff-5d97531ed54d2f8c4d91ebce0fb91774R170

meejah referenced this issue in TheTorProject/bwscanner Mar 22, 2018
to don't get error about options that can't be changed once it's launched.
@meejah
Copy link
Owner Author

meejah commented Mar 22, 2018

Hmm, how would that happen? I guess if you created two TorConfig objects connected to the same protocol "at the same time", and called .save() on one while the other was still bootstrapping..?

@meejah
Copy link
Owner Author

meejah commented Mar 22, 2018

But also hmm: I don't think anything bad happens if we get a CONF_CHANGED while bootstrapping (or at least i can't make a unit-test do any bad stuff)

@juga0
Copy link

juga0 commented Mar 23, 2018

I'm not sure what you mean. I see 3 cases:

  1. There're options that can not be changed on a running tor instance, but i don't recall now the error (if any) they give.
  2. In the code previously linked, i think it happened what you mention, since tor.config is not an attribute of Tor and it was getting assigned a new TorConfig object
  3. As a different question (maybe new issue), which is the recommended way to change the configuration when connecting to tor?. I've try to updated the config in TheTorProject/bwscanner@b9ad1a5#diff-5d97531ed54d2f8c4d91ebce0fb91774R77 and now i actually got CONF_CHANGED https://travis-ci.org/TheTorProject/bwscanner/jobs/357532664 :)

@meejah
Copy link
Owner Author

meejah commented Apr 1, 2018

@juga0 that way (in the linked code) looks good to me -- but that CONF_CHANGED thing is interesting! I guess it's somehow getting a 650 event while still reading the consensus?!

@meejah
Copy link
Owner Author

meejah commented Apr 1, 2018

Could be a bug in .get_config returning too soon...?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants