Opened 10 months ago

Last modified 5 months ago

#28363 assigned enhancement

Make a torrc option which prevents Tor from falling asleep

Reported by: wagon Owned by:
Priority: Medium Milestone: Tor: unspecified
Component: Core Tor/Tor Version:
Severity: Normal Keywords:
Cc: cypherpunks Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Now, if Tor client doesn't see any activity within certain period of time on its SocksPort, it closes all circuits and disconnects from Internet. This may lead to troubles with some ISPs, where manual intervention is needed to connect to Internet again. It would be good to have an option which allows users to specify this period of inactivity manually (so it can be set to some big value), or an option which disables this behavior completely.

Child Tickets

Change History (12)

comment:1 Changed 10 months ago by catalyst

Milestone: Tor: unspecified
Sponsor: Sponsor8-can

comment:2 Changed 8 months ago by gaba

Sponsor: Sponsor8-can

comment:3 Changed 8 months ago by nickm

Keywords: 040-proposed added

I think we should do this postfreeze in 040 to make dormant mode more useful.

comment:4 Changed 8 months ago by teor

Status: assignednew

Please don't assign tickets to arma.

comment:5 Changed 8 months ago by teor

Owner: arma deleted
Status: newassigned

Please don't assign tickets to anyone on the network team. Instead, let us decide how we want to handle a ticket.

comment:6 in reply to:  5 Changed 8 months ago by wagon

Replying to teor:

Please don't assign tickets to anyone on the network team. Instead, let us decide how we want to handle a ticket.

I'm sorry. I did it in the past, but I'm not doing it now. This ticket is 2 months old, so it was during the time when I did assignments.

Historically it had the following reason. Long time ago I noticed that some tor browser tickets do not get any attention or replies for years if they are not assigned and nobody is in cc. If such tickets get cc or assignment, they immediately get some feedback from tor team. I extrapolated this property from tor browser tickets to all tor tickets, which it was wrong, because core tor tickets are managed properly and in time. Thanks for that.

comment:7 Changed 8 months ago by nickm

It would be good to have an option which allows users to specify this period of inactivity manually

DormantClientTimeout is this option; you can set it to weeks or years. Is that good enough, or do we need more here?

comment:8 in reply to:  7 Changed 8 months ago by wagon

Replying to nickm:

Is that good enough, or do we need more here?

It sounds as exactly the thing I wanted. However, I'm confused by documentation:

DormantClientTimeout N minutes|hours|days|weeks

If Tor spends this much time without any client activity, enter a dormant state where automatic circuits are not built, and directory information is not fetched. Does not affect servers or onion services. Must be at least 10 minutes. (Default: 24 hours)

Did you change this default timeout in recent Tor versions? It wasn't 24 hours. I cannot say exactly, but according to my feelings Tor falls asleep and closes all its circuits after very short period of inactivity, probably 20-40 minutes.

comment:9 Changed 8 months ago by nickm

Dormant mode only exists in 0.4.0.x later; if you're seeing a change in recent releases, then it's not dormant mode that you're seeing. Also, dormant mode isn't supposed to make Tor close its circuits, so that's another reason this isn't likely to be dormant mode.

What's the first version where you have seen this problem? And are the steps to reproduce it just "wait 60 minutes and use a control port to ask what circuits there are?"

comment:10 Changed 8 months ago by wagon

What's the first version where you have seen this problem?

I cannot remember, but I did saw it within last year for last stable Tor versions.

And are the steps to reproduce it just "wait 60 minutes and use a control port to ask what circuits there are?"

It is an example, but it is easier to see. Check your netstat or ss, and you will see that your Tor client is not connected to any relay, and there is no open TCP connections. I assumed it is well known behavior of Tor (closing all circuits and disconnecting from Tor network, if no application is using it during some period of inactivity). Yes, it wasn't related to any dormant mode as it was before 0.4.0.x.

Now you introduced dormant mode and say that default inactivity period is 24h, which is many times higher than the original inactivity timeout for old versions. That is why I was surprised and asked you about it.

if you're seeing a change in recent releases, then it's not dormant mode that you're seeing.

Yes, it is not literally dormant mode, but it imitates it. I didn't see any change, I just tell you that this is how Tor before 0.4.0.x behaves (according to my current understanding). Later I read man page for 0.4.0.x and saw that it should behave differently, i.e. with much higher period of inactivity.

comment:11 Changed 7 months ago by nickm

Keywords: 040-proposed removed

comment:12 Changed 5 months ago by cypherpunks

Cc: cypherpunks added
Note: See TracTickets for help on using tickets.