Opened 13 years ago

Last modified 7 years ago

#342 closed defect (Fixed)

No connections after start of next interval of AccountingStart?

Reported by: Maschi Owned by: nickm
Priority: Low Milestone: 0.1.2.x-final
Component: Core Tor/Tor Version: 0.1.2.1-alpha
Severity: Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

The server 'roundabout' started a new interval on 4th Oct. 00:00.
By this time no traffic amount is logged as related to Tor (as of 4th Oct. 18:38) although notices.log
shows the messages that the server should be waked up at 08:05:24 local time.

torrc has the following settings:
AccountingStart month 4 00:00
AccountingMax 145 GB

The file /var/log/tor/notices.log shows the following:
---snip---
Oct 04 00:00:00.011 [notice] accounting_set_wakeup_time(): Configured hibernation. This interval began at 2006-10-04 00:00:00; the scheduled wake-up time is 2006-10-04 08:05:24; we expect to exhaust our quota for this interval around 2006-11-03 20:43:24; the next interval begins at 2006-11-04 00:00:00 (all times local)
Oct 04 00:00:01.031 [notice] consider_hibernation(): Commencing hibernation. We will wake up at 2006-10-04 08:05:24 local time.
Oct 04 00:00:01.031 [notice] hibernate_go_dormant(): Going dormant. Blowing away remaining connections.
Oct 04 00:26:28.771 [notice] I learned some more directory information, but not enough to build a circuit.
Oct 04 00:56:57.609 [notice] I learned some more directory information, but not enough to build a circuit.
[....]
Oct 04 07:44:40.899 [notice] I learned some more directory information, but not enough to build a circuit.
Oct 04 08:15:10.531 [notice] I learned some more directory information, but not enough to build a circuit.
[....]
Oct 04 17:30:22.398 [notice] I learned some more directory information, but not enough to build a circuit.
Oct 04 18:00:54.076 [notice] I learned some more directory information, but not enough to build a circuit.
Oct 04 18:31:24.745 [notice] I learned some more directory information, but not enough to build a circuit.
---snap---

[....] means the messages repeated with different timestamps.

[Automatically added by flyspray2trac: Operating System: Other Linux]

Child Tickets

Change History (6)

comment:1 Changed 13 years ago by dbane

I saw the same problem on 0.1.1.24/Linux, but it started listening again a few hours later. I think what happens is that one period goes over its bandwidth allocation, then starting the next period is postponed to compensate. Here is part of my torrc:

--begin----------
AccountingStart day 09:00
AccountingMax 3 GB
BandwidthRate 60 KB
--end----------

and here's the end of notices.log:

--begin----------
Oct 19 08:57:16.333 [notice] consider_hibernation(): Bandwidth soft limit reached; commencing hibernation.
Oct 19 09:00:00.179 [notice] accounting_set_wakeup_time(): Configured hibernation. This interval began at 2006-10-19 09:00:00; the scheduled wake-up time is 2006-10-19 12:50:30; we expect to exhaust our quota for this interval around 2006-10-20 08:54:30; the next interval begins at 2006-10-20 09:00:00 (all times local)
Oct 19 09:00:00.179 [notice] hibernate_end_time_elapsed(): Accounting period ended. Commencing hibernation until 2006-10-19 11:50:30 GMT
Oct 19 09:00:00.179 [notice] hibernate_go_dormant(): Going dormant. Blowing away remaining connections.
Oct 19 12:50:30.491 [notice] hibernate_end(): Hibernation period ended. Resuming normal activity.
--end----------

comment:2 Changed 12 years ago by nickm

Okay, I think I've got it. In consider_hibernation:

if (hibernate_state == HIBERNATE_STATE_DORMANT) {

/* We've been hibernating because of bandwidth accounting. */
tor_assert(hibernate_end_time);
if (hibernate_end_time > now && accounting_enabled) {

/* If we're hibernating, don't wake up until it's time, regardless of

  • whether we're in a new interval. */

return ;

} else {

hibernate_end_time_elapsed(now);

}

}

Note that this looks only at hibernate_end_time, which is okay, since that's when we're supposed to
consider waking up.

It looks like we tried to make this do the right thing in hibernate_end_time_elapsed() with:

/* The interval has changed, and it isn't time to wake up yet. */
hibernate_end_time = interval_wakeup_time;

But this only sets end_time to wakeup_time when we hit the end of an interval, not when we start out
in a hibernating state. Ouch! In effect, if we start out in an interval before the wakeup time, we
won't actually consider

The right solution is probably to set hibernate_end_time in hibernate_go_dormant().

[Edited: I was confused; interval_end_time != hibernate_end_time.]

comment:3 Changed 12 years ago by nickm

Checked in a possible fix as of r9512. Can anybody test this?

comment:4 Changed 12 years ago by nickm

Okay, I've played with the fix and I'm pretty sure it's right. Marking this fixed. Please re-open the bug if I'm mistaken and it still happens.

comment:5 Changed 12 years ago by nickm

flyspray2trac: bug closed.
Fixed in r9512; fix will appear in 0.1.2.8

comment:6 Changed 7 years ago by nickm

Component: Tor RelayTor
Note: See TracTickets for help on using tickets.