monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] netsync with unix-domain sockets


From: Brian May
Subject: Re: [Monotone-devel] netsync with unix-domain sockets
Date: Mon, 14 Jan 2008 19:00:14 +1100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

>>>>> "Roland" == Roland McGrath <address@hidden> writes:

    Roland> Has anyone tried using unix domain sockets for netsync?
    Roland> I tried:

    Roland> mtn --db foo.mtn serve --bind local:///tmp/foobar

    Roland> and:

    Roland> mtn --db bar.mtn pull local:///tmp/foobar

    Roland> The client and server get connected fine.  Then they both sit there 
like
    Roland> they're waiting for someone to say something, and never do anything.

strace of Server on pegasos powerpc Debian/etch using mtn recompiled
from sid:

...
socket(PF_FILE, SOCK_STREAM, 0)         = 5
fcntl64(5, F_GETFL)                     = 0x2 (flags O_RDWR)
setsockopt(5, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
bind(5, {sa_family=AF_FILE, path="/tmp/foobar2"}, 110) = 0
chmod("/tmp/foobar2", 0666)             = 0
listen(5, 128)                          = 0
write(2, "mtn: beginning service on /tmp/f"..., 43mtn: beginning service on 
/tmp/foobar2 : 0
) = 43
fcntl64(4, F_SETLK64, {type=F_RDLCK, whence=SEEK_SET, start=1073741824, len=1}, 
0x7fd597d8) = 0
fcntl64(4, F_SETLK64, {type=F_RDLCK, whence=SEEK_SET, start=1073741826, 
len=510}, 0x7fd597d8) = 0
fcntl64(4, F_SETLK64, {type=F_UNLCK, whence=SEEK_SET, start=1073741824, len=1}, 
0x7fd597d8) = 0
access("/home/bam/monotone/config.mtn-journal", F_OK) = -1 ENOENT (No such file 
or directory)
fstat64(4, {st_mode=S_IFREG|0600, st_size=1818624, ...}) = 0
pread64(4, "\0\0\0L\0\0\0\0\0\0\0\0\0\0\0\0", 16, 24) = 16
fcntl64(4, F_SETLK64, {type=F_WRLCK, whence=SEEK_SET, start=1073741825, len=1}, 
0x7fd59858) = 0
fcntl64(4, F_SETLK64, {type=F_WRLCK, whence=SEEK_SET, start=1073741824, len=1}, 
0x7fd59838) = 0
fcntl64(4, F_SETLK64, {type=F_WRLCK, whence=SEEK_SET, start=1073741826, 
len=510}, 0x7fd59838) = 0
open("/home/bam/monotone/config.mtn-journal", 
O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE, 0644) = 6
fcntl64(6, F_GETFD)                     = 0
fcntl64(6, F_SETFD, FD_CLOEXEC)         = 0
fstat64(6, {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
open("/home/bam/monotone", O_RDONLY|O_LARGEFILE) = 7
fcntl64(7, F_GETFD)                     = 0
fcntl64(7, F_SETFD, FD_CLOEXEC)         = 0
pwrite64(6, "\331\325\5\371 \241c\327\0\0\0\0\276C\\l\0\0\0\336\0\0"..., 24, 0) 
= 24
pwrite64(6, "\0", 1, 1023)              = 1
select(6, [5], [5], [5], NULL)          = 1 (out [5])
select(6, [5], NULL, NULL, {21600, 0})  = 1 (in [5], left {21567, 344000})
fcntl64(5, F_GETFL)                     = 0x2 (flags O_RDWR)
fcntl64(5, F_GETFL)                     = 0x2 (flags O_RDWR)
fcntl64(5, F_SETFL, O_RDWR|O_NONBLOCK)  = 0
accept(5, {sa_family=AF_FILE, address@hidden, [2]) = 8
fcntl64(5, F_SETFL, O_RDWR)             = 0
write(2, "mtn: accepted new client connect"..., 52mtn: accepted new client 
connection from ¼0 hÀ : 0
) = 52
fcntl64(8, F_GETFL)                     = 0x2 (flags O_RDWR)
fcntl64(8, F_GETFL)                     = 0x2 (flags O_RDWR)
fcntl64(8, F_SETFL, O_RDWR|O_NONBLOCK)  = 0
time(NULL)                              = 1200296745
pread64(4, "\5\0\0\0\3\37\357\0\0\0\0\327\37\373\37\365\37\357\0\0"..., 8192, 
90112) = 8192
pread64(4, "\r\0\0\0^\0\362\0\37\323\37~\37)\36\324\36\177\36*\35\325"..., 
8192, 565248) = 8192
pread64(4, "\r\0\0\0]\0\343\0\37\253\37V\37\1\36\254\36W\36\2\35\255"..., 8192, 
573440) = 8192
pread64(4, "\r\0\0\0]\0\302\0\37\252\37T\36\376\36\250\36R\35\374\35"..., 8192, 
1335296) = 8192
pread64(4, "\r\0\0\0\22\31\364\0\37\252\37T\36\376\36\250\36R\35\374"..., 8192, 
1753088) = 8192
time(NULL)                              = 1200296745
times({tms_utime=28, tms_stime=2, tms_cutime=0, tms_cstime=0}) = 1868134796
time(NULL)                              = 1200296745
times({tms_utime=28, tms_stime=2, tms_cutime=0, tms_cstime=0}) = 1868134796
time(NULL)                              = 1200296745
times({tms_utime=28, tms_stime=2, tms_cutime=0, tms_cstime=0}) = 1868134796
select(6, [5], [5], [5], {0, 0})        = 1 (out [5], left {0, 0})
select(6, [5], NULL, NULL, {21600, 0} [hangs here]



strace of client:

write(2, "mtn: connecting to local:///tmp/"..., 40mtn: connecting to 
local:///tmp/foobar2
) = 40
socket(PF_FILE, SOCK_STREAM, 0)         = 7
fcntl64(7, F_GETFL)                     = 0x2 (flags O_RDWR)
fcntl64(7, F_GETFL)                     = 0x2 (flags O_RDWR)
fcntl64(7, F_SETFL, O_RDWR|O_NONBLOCK)  = 0
connect(7, {sa_family=AF_FILE, path="/tmp/foobar2"}, 110) = 0
fcntl64(7, F_SETFL, O_RDWR)             = 0
fcntl64(7, F_GETFL)                     = 0x2 (flags O_RDWR)
fcntl64(7, F_GETFL)                     = 0x2 (flags O_RDWR)
fcntl64(7, F_SETFL, O_RDWR|O_NONBLOCK)  = 0
time(NULL)                              = 1200296745
pread64(4, "\r\0\0\0\0 \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 8192, 
57344) = 8192
select(8, [7], [], [7], {21600, 0} [hangs here]



Both server and client appear to be waiting for the other to start
talking first. Who is suppose to start talking first?

If I abort the client, the server gets confused and starts printing
garbage values:



rt_sigaction(SIGPIPE, {SIG_IGN}, {0x1032e7e0, [HUP INT PIPE TERM], SA_ONESHOT}, 
8) = 0
socket(PF_FILE, SOCK_STREAM, 0)         = 5
fcntl64(5, F_GETFL)                     = 0x2 (flags O_RDWR)
setsockopt(5, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
bind(5, {sa_family=AF_FILE, path="/tmp/foobar2"}, 110) = 0
chmod("/tmp/foobar2", 0666)             = 0
listen(5, 128)                          = 0
write(2, "mtn: beginning service on /tmp/f"..., 43mtn: beginning service on 
/tmp/foobar2 : 0
) = 43
fcntl64(4, F_SETLK64, {type=F_RDLCK, whence=SEEK_SET, start=1073741824, len=1}, 
0x7fd597d8) = 0
fcntl64(4, F_SETLK64, {type=F_RDLCK, whence=SEEK_SET, start=1073741826, 
len=510}, 0x7fd597d8) = 0
fcntl64(4, F_SETLK64, {type=F_UNLCK, whence=SEEK_SET, start=1073741824, len=1}, 
0x7fd597d8) = 0
access("/home/bam/monotone/config.mtn-journal", F_OK) = -1 ENOENT (No such file 
or directory)
fstat64(4, {st_mode=S_IFREG|0600, st_size=1818624, ...}) = 0
pread64(4, "\0\0\0L\0\0\0\0\0\0\0\0\0\0\0\0", 16, 24) = 16
fcntl64(4, F_SETLK64, {type=F_WRLCK, whence=SEEK_SET, start=1073741825, len=1}, 
0x7fd59858) = 0
fcntl64(4, F_SETLK64, {type=F_WRLCK, whence=SEEK_SET, start=1073741824, len=1}, 
0x7fd59838) = 0
fcntl64(4, F_SETLK64, {type=F_WRLCK, whence=SEEK_SET, start=1073741826, 
len=510}, 0x7fd59838) = 0
open("/home/bam/monotone/config.mtn-journal", 
O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE, 0644) = 6
fcntl64(6, F_GETFD)                     = 0
fcntl64(6, F_SETFD, FD_CLOEXEC)         = 0
fstat64(6, {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
open("/home/bam/monotone", O_RDONLY|O_LARGEFILE) = 7
fcntl64(7, F_GETFD)                     = 0
fcntl64(7, F_SETFD, FD_CLOEXEC)         = 0
pwrite64(6, "\331\325\5\371 \241c\327\0\0\0\0\276C\\l\0\0\0\336\0\0"..., 24, 0) 
= 24
pwrite64(6, "\0", 1, 1023)              = 1
select(6, [5], [5], [5], NULL)          = 1 (out [5])
select(6, [5], NULL, NULL, {21600, 0})  = 1 (in [5], left {21567, 344000})
fcntl64(5, F_GETFL)                     = 0x2 (flags O_RDWR)
fcntl64(5, F_GETFL)                     = 0x2 (flags O_RDWR)
fcntl64(5, F_SETFL, O_RDWR|O_NONBLOCK)  = 0
accept(5, {sa_family=AF_FILE, address@hidden, [2]) = 8
fcntl64(5, F_SETFL, O_RDWR)             = 0
write(2, "mtn: accepted new client connect"..., 52mtn: accepted new client 
connection from ¼0 hÀ : 0
) = 52
fcntl64(8, F_GETFL)                     = 0x2 (flags O_RDWR)
fcntl64(8, F_GETFL)                     = 0x2 (flags O_RDWR)
fcntl64(8, F_SETFL, O_RDWR|O_NONBLOCK)  = 0
time(NULL)                              = 1200296745
pread64(4, "\5\0\0\0\3\37\357\0\0\0\0\327\37\373\37\365\37\357\0\0"..., 8192, 
90112) = 8192
pread64(4, "\r\0\0\0^\0\362\0\37\323\37~\37)\36\324\36\177\36*\35\325"..., 
8192, 565248) = 8192
pread64(4, "\r\0\0\0]\0\343\0\37\253\37V\37\1\36\254\36W\36\2\35\255"..., 8192, 
573440) = 8192
pread64(4, "\r\0\0\0]\0\302\0\37\252\37T\36\376\36\250\36R\35\374\35"..., 8192, 
1335296) = 8192
pread64(4, "\r\0\0\0\22\31\364\0\37\252\37T\36\376\36\250\36R\35\374"..., 8192, 
1753088) = 8192
time(NULL)                              = 1200296745
times({tms_utime=28, tms_stime=2, tms_cutime=0, tms_cstime=0}) = 1868134796
time(NULL)                              = 1200296745
times({tms_utime=28, tms_stime=2, tms_cutime=0, tms_cstime=0}) = 1868134796
time(NULL)                              = 1200296745
times({tms_utime=28, tms_stime=2, tms_cutime=0, tms_cstime=0}) = 1868134796
select(6, [5], [5], [5], {0, 0})        = 1 (out [5], left {0, 0})
select(6, [5], NULL, NULL, {21600, 0}



Results look the same with --no-transport-auth.
-- 
Brian May <address@hidden>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]