[9fans] patch/create problem (error?) - Plan9

This is a discussion on [9fans] patch/create problem (error?) - Plan9 ; Hello all, I had problem to create a patch - the command didn't finish for long long time. I tried to do it manualy step by step from command line and it seems that the problem is with "cp" command. ...

+ Reply to Thread
Results 1 to 9 of 9

Thread: [9fans] patch/create problem (error?)

  1. [9fans] patch/create problem (error?)

    Hello all,

    I had problem to create a patch - the command didn't finish for long long time.
    I tried to do it manualy step by step from command line and it seems
    that the problem is with "cp" command.
    This is method how to repeat it:

    I have in my home dir prepared new version of tftpd.c

    ls -l $home/src/tftpd
    --rw-rw-r-- M 40 antonin antonin 7708 Sep 11 14:59
    /usr/antonin/src/tftpd/tftpd.c

    1. bind -b -c $home/src/tftpd /sys/src/cmd/ip
    2. 9fs sources
    3. cp /sys/src/cmd/ip/tftpd.c /n/sources/patch/tftpd-error
    ....and now it hangs.

    If I copy to /n/sources regular file, things go right.
    If I try to copy file from bind-ed dir, "cp" hangs.

    Maybe I am somewhere wrong, I am not sure.

    Antonin


  2. Re: [9fans] patch/create problem (error?)

    > I had problem to create a patch - the command didn't finish for long long time.

    I created a patch yesterday and it worked fine. It is fairly slow as it
    diff's all the files you have changed with those on sources.

    Sadly the 9p protocol is quite badly effected by high (intercontinential) RTTs.

    -Steve


  3. Re: [9fans] patch/create problem (error?)

    On Fri, Sep 12, 2008 at 9:54 AM, Steve Simon wrote:
    >> I had problem to create a patch - the command didn't finish for long long time.

    >
    > I created a patch yesterday and it worked fine. It is fairly slow as it
    > diff's all the files you have changed with those on sources.
    >
    > Sadly the 9p protocol is quite badly effected by high (intercontinential) RTTs.
    >
    > -Steve


    There were only 2 files in the patch. I wait for about 10 minutes and nothing.
    But then I tried to copy a file from command line.
    If I copied an ordinary file (to /n/sources) it was done immediately.
    But If I copied a file from bind-ed(!) directory it was endless...
    There was no diff, only copy file.

    Antonin


  4. Re: [9fans] patch/create problem (error?)

    >>> I had problem to create a patch - the command didn't finish for long long time.
    >>
    >> I created a patch yesterday and it worked fine. It is fairly slow as it
    >> diff's all the files you have changed with those on sources.
    >>
    >> Sadly the 9p protocol is quite badly effected by high (intercontinential) RTTs.
    >>
    >> -Steve

    >
    > There were only 2 files in the patch. I wait for about 10 minutes and nothing.
    > But then I tried to copy a file from command line.
    > If I copied an ordinary file (to /n/sources) it was done immediately.
    > But If I copied a file from bind-ed(!) directory it was endless...
    > There was no diff, only copy file.


    i would guess the problem is a bit different. i'm assuming that
    reads from sources work fine. it's not until you try to write there
    that there's a problem.

    this sounds like a mtu problem. i have a similar problem.
    i am not able to submit patches over one particular
    network interface. however, if i use a lower mtu, things work fine.
    i believe this is because the dumpy dsl modem we have
    blocks icmp messages.

    you could lower the mtu on the interface, but rather than
    punishing all traffic, i wrote a program called cpmtu. cpmtu
    is attached. if you define this function
    fn cp {cpmtu -m 700 $*}
    before you run patch/create, i believe patch should work
    properly for you.

    as an aside: i don't think 9p itself limits plan 9 performance
    over high-latency links. the limitations have more to do with
    the number of outstanding messages, which is 1 in the mnt
    driver.

    - erik


  5. Re: [9fans] patch/create problem (error?)

    On Fri, Sep 12, 2008 at 1:47 PM, erik quanstrom wrote:
    >>>> I had problem to create a patch - the command didn't finish for long long time.
    >>>
    >>> I created a patch yesterday and it worked fine. It is fairly slow as it
    >>> diff's all the files you have changed with those on sources.
    >>>
    >>> Sadly the 9p protocol is quite badly effected by high (intercontinential) RTTs.
    >>>
    >>> -Steve

    >>
    >> There were only 2 files in the patch. I wait for about 10 minutes and nothing.
    >> But then I tried to copy a file from command line.
    >> If I copied an ordinary file (to /n/sources) it was done immediately.
    >> But If I copied a file from bind-ed(!) directory it was endless...
    >> There was no diff, only copy file.

    >
    > i would guess the problem is a bit different. i'm assuming that
    > reads from sources work fine. it's not until you try to write there
    > that there's a problem.
    >
    > this sounds like a mtu problem. i have a similar problem.
    > i am not able to submit patches over one particular
    > network interface. however, if i use a lower mtu, things work fine.
    > i believe this is because the dumpy dsl modem we have
    > blocks icmp messages.
    >
    > you could lower the mtu on the interface, but rather than
    > punishing all traffic, i wrote a program called cpmtu. cpmtu
    > is attached. if you define this function
    > fn cp {cpmtu -m 700 $*}
    > before you run patch/create, i believe patch should work
    > properly for you.
    >
    > as an aside: i don't think 9p itself limits plan 9 performance
    > over high-latency links. the limitations have more to do with
    > the number of outstanding messages, which is 1 in the mnt
    > driver.
    >
    > - erik
    >


    It seems you are right. I think I used in my previous tests too
    specific (small) files.
    I will try to play with mtu and with your "cpmtu".

    Anyway, does 9P and Plan9 know about "path MTU discovery"?
    Or have I something wrong at my firewall/router?
    Other of my computers (FreeBSD,Windows) don't have such problems.

    Antonin


  6. Re: [9fans] patch/create problem (error?)

    > Anyway, does 9P and Plan9 know about "path MTU discovery"?

    traditional path mtu uses icmp messages. if your router/modem/whatever
    eats icmp, you're outta luck with these traditional methods.
    cf. http://www.netheaven.com/pmtu.html i think there are some tricks
    to get around the missing icmp messages, though.

    > Or have I something wrong at my firewall/router?
    > Other of my computers (FreeBSD,Windows) don't have such problems.


    have you tried mounting sources from these machines?

    i think this problem is pecular to sources. if the pmtu is
    symmetric, it seems sources is a few bytes short of a full packet.
    1510 bytes. yet when i read from a local machine, the tcp
    packets are a bit long of a full packet -- 1518 bytes.

    something to look into.

    - erik


  7. Re: [9fans] patch/create problem (error?)

    On Fri, Sep 12, 2008 at 8:16 PM, erik quanstrom wrote:
    >> Anyway, does 9P and Plan9 know about "path MTU discovery"?

    >
    > traditional path mtu uses icmp messages. if your router/modem/whatever
    > eats icmp, you're outta luck with these traditional methods.
    > cf. http://www.netheaven.com/pmtu.html i think there are some tricks
    > to get around the missing icmp messages, though.
    >
    >> Or have I something wrong at my firewall/router?
    >> Other of my computers (FreeBSD,Windows) don't have such problems.

    >
    > have you tried mounting sources from these machines?
    >
    > i think this problem is pecular to sources. if the pmtu is
    > symmetric, it seems sources is a few bytes short of a full packet.
    > 1510 bytes. yet when i read from a local machine, the tcp
    > packets are a bit long of a full packet -- 1518 bytes.
    >
    > something to look into.
    >
    > - erik


    I solved it.
    The source of this problem was an old NAT program on my router.
    Thanks Erik, you show me where to look for it.

    Antonin


  8. Re: [9fans] patch/create problem (error?)

    > fn cp {cpmtu -m 700 $*}

    How about dd?

    Dave Eckhardt


  9. Re: [9fans] patch/create problem (error?)

    On Sat Sep 13 21:13:15 EDT 2008, davide+p9@cs.cmu.edu wrote:
    > > fn cp {cpmtu -m 700 $*}

    >
    > How about dd?
    >
    > Dave Eckhardt
    >


    dd behaves differently from cp, and patch/create
    uses cp. in particular cp tries to copy the mode
    bits along.

    i thought it would be easier to be correct in adding
    4 lines to cp than writing a shim than makes dd work
    like cp. especially since cpmtu had already been
    written.

    i could be wrong, but that's what i was thinking.

    by the way, my method is completely bogus and
    accidentally works most of the time. that should
    be obvious from the fact that i'm using an mtu of
    700 rather than 1500 or even 1510. tcp, being a
    stream protcol, doesn't respect write boundaries.
    so even if the 9p messages are small enough, tcp
    helpfully packs them together.

    (unfortunately changing the mtu on a running interface
    hung the interface. i don't know if this behavior
    persists.)

    9p2000 mostly hides the stream nature of tcp,
    but once in a while it rears its head.

    - erik


+ Reply to Thread