#1469 closed defect (fixed)

new random introducer port on each start

Reported by: T_X Owned by: davidsarah
Priority: critical Milestone: 1.9.0
Component: code Version: 1.8.2
Keywords: introducer port random regression reviewed Cc:
Launchpad Bug:

Description

The patch from #1385, commit 2d16a16ee3d99482, does not seem fully fix the issue from e5c4e83f4cfe3769 (or introduces a new issue): When starting the introducer, it always sets a new random port in both introducer.furl and introducer.port (without any complaints though).

I've been using 'darcs obliterate' and 'darcs pull' to track this down to commits e5c4e83f4cfe3769 + 2d16a16ee3d99482, have been 'darcs obliterat'ing until 420e3aa2930cf1e7. This commit still works. Applying e5c4e83f4cfe3769 + 2d16a16ee3d99482 on top of 420e3aa2930cf1e7 does not seem to work anymore and introduces this random port issue for me.

Attachments (4)

tahoe.cfg (520 bytes) - added by T_X at 2011-08-04T21:48:22Z.
tahoe.cfg of the buggy introducer node
fix-1469.darcs.patch (27.8 KB) - added by davidsarah at 2011-08-06T23:28:00Z.
node.py: ensure that client and introducer nodes record their port number and use that port on the next restart, fixing a regression caused by #1385. fixes #1469.
test-1469.darcs.patch (33.9 KB) - added by davidsarah at 2011-08-06T23:28:37Z.
test_runner.py: test that client and introducer nodes record their port number and use that port on the next restart. This tests for a regression caused by ref #1385.
all-including-cleanups-1469.darcs.patch (44.1 KB) - added by davidsarah at 2011-08-06T23:29:33Z.
Includes fix, tests, and cleanups of the test code.

Download all attachments as: .zip

Change History (13)

comment:1 in reply to: ↑ description Changed at 2011-08-04T16:35:10Z by davidsarah

  • Keywords regression added
  • Owner changed from somebody to T_X

Replying to T_X:

The patch from #1385, commit 2d16a16ee3d99482, does not seem fully fix the issue from e5c4e83f4cfe3769 (or introduces a new issue): When starting the introducer, it always sets a new random port in both introducer.furl and introducer.port (without any complaints though).

Please attach the tahoe.cfg for the introducer, and a listing of the introducer base directory.

Changed at 2011-08-04T21:48:22Z by T_X

tahoe.cfg of the buggy introducer node

comment:2 Changed at 2011-08-04T21:49:26Z by T_X

Listing of the introducer node's base directory:

$ ls -lah /home/mesh-node/.tahoe-intro
total 40K
drwxr-xr-x  5 mesh-node mesh-node 4.0K Aug  4 20:39 .
drwxr-xr-x 23 mesh-node mesh-node 4.0K Aug  4 20:39 ..
-rw-------  1 mesh-node mesh-node   84 Aug  4 20:39 introducer.furl
-rw-------  1 mesh-node mesh-node    6 Aug  4 20:39 introducer.port
drwxr-xr-x  3 mesh-node mesh-node 4.0K Jul 29 15:27 logs
-rw-r--r--  1 mesh-node mesh-node   33 Aug  4 20:39 my_nodeid
drwx------  2 mesh-node mesh-node 4.0K Jul 29 15:27 private
-rw-r--r--  1 mesh-node mesh-node  520 Jul 29 15:27 tahoe.cfg
-rw-r--r--  1 mesh-node mesh-node  311 Jul 29 15:27 tahoe-introducer.tac
drwxr-xr-x  2 mesh-node mesh-node 4.0K Jul 29 15:27 tmp

Changed at 2011-08-06T23:28:00Z by davidsarah

node.py: ensure that client and introducer nodes record their port number and use that port on the next restart, fixing a regression caused by #1385. fixes #1469.

Changed at 2011-08-06T23:28:37Z by davidsarah

test_runner.py: test that client and introducer nodes record their port number and use that port on the next restart. This tests for a regression caused by ref #1385.

Changed at 2011-08-06T23:29:33Z by davidsarah

Includes fix, tests, and cleanups of the test code.

comment:3 Changed at 2011-08-06T23:34:51Z by davidsarah

  • Keywords review-needed added
  • Owner T_X deleted

The problem was that e5c4e83f4cfe3769, in addition to removing the code that read the old config files, removed the code that read config.port (for a client node) or introducer.port (for an introducer).

comment:4 Changed at 2011-08-06T23:44:47Z by zooko

  • Owner set to zooko
  • Status changed from new to assigned

comment:5 follow-up: Changed at 2011-08-07T00:10:40Z by zooko

Good patch! The only thing I might possibly do different is that this method named _remove is redundant with (but probably better than) fileutil.remove_if_possible. Anyway: +1

comment:6 Changed at 2011-08-07T00:11:58Z by zooko

  • Keywords reviewed added; review-needed removed
  • Owner changed from zooko to davidsarah
  • Status changed from assigned to new

comment:7 Changed at 2011-08-07T00:25:24Z by david-sarah@…

In b9121e045fe2894c:

test_runner.py: fix a race condition in the test when NODE_URL_FILE is written before PORTNUM_FILE. refs #1469

comment:8 Changed at 2011-08-07T00:48:02Z by david-sarah@…

  • Resolution set to fixed
  • Status changed from new to closed

In 05684b9251780046:

node.py: ensure that client and introducer nodes record their port number and use that port on the next restart, fixing a regression caused by #1385. fixes #1469.

comment:9 in reply to: ↑ 5 Changed at 2011-08-07T00:53:06Z by davidsarah

Replying to zooko:

Good patch! The only thing I might possibly do different is that this method named _remove is redundant with (but probably better than) fileutil.remove_if_possible. Anyway: +1

I changed it to use fileutil.remove, which is exactly what is needed. (Fail if the file doesn't get removed, but succeed if it didn't exist to start with or was removed concurrently.)

Note: See TracTickets for help on using tickets.