SIGPIPE handling of xbstream

Bug #1273207 reported by Raghavendra D Prabhu on 2014-01-27
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona XtraBackup
High
Alexey Kopytov
2.1
High
Alexey Kopytov
2.2
High
Alexey Kopytov

Bug Description

As reported in
https://bugs.launchpad.net/percona-xtrabackup/+bug/1273196/comments/3
and
https://bugs.launchpad.net/percona-xtrabackup/+bug/1273196/comments/4

xbstream doesn't exit when pipe breaks.

It loops around like

read(0, "", 327721) = 0
read(0, "", 327721) = 0
read(0, "", 327721) = 0
read(0, "", 327721) = 0

while others have exited from broken pipe.

This can affect SST and/or any processes which depend on the
completion.

While run interactively, a Ctrl-C (SIGINT) is required to break
the hang. (and kill xbstream)

Tags: pxc Edit Tag help
tags: added: pxc

read(0, "", 327721) = 0

should probably cause xbstream to exit, ie, when it gets nothing from the network. (Now, it depends on how xbstream handles stream and listens on stdin)

Download full text (3.9 KiB)

(gdb) bt full
#0 0x00007f530e02ea7d in read () from /usr/lib/libpthread.so.0
No symbol table info available.
#1 0x000000000040a9f8 in read (__nbytes=65577, __buf=0x7f530e606fe7, __fd=0) at /usr/include/bits/unistd.h:44
No locals.
#2 my_read (Filedes=Filedes@entry=0,
    Buffer=0x7f530e606fe7 "I\352w6\347\003\177\375\276\022˨\033\312\070>@h\245\303M\206l\230ܤ$\216\320mB\266\262o\354\200߲\003(dxD<}\300\ah@\030\005\260\177\275\317\017\027\300 \231C\213ӵ\211\061zM\037\f\224\363b\017\275\241\201\375#;\006O\243\063m\325ס\200\n\334\021\344\347*\371\200b\246\021L\207f\t\303\315L\276:\216\253\060\312\vɎED\206b\236٫A\211m \026\321=IW\034|\204\375=pV$\226\221\035\071I\376\352S\213\370\234\062\207\377\240\235\363)VR\247N\323\v+.o\001\354@(\346\324\066Ed\352~\313S\302\373x\213\356\356\036\025\354\225[E\274", <incomplete sequence \347>, Count=65577, MyFlags=MyFlags@entry=528)
    at /dev/shm/xtrabackup/src/percona-xtrabackup-2.1.7/Percona-Server-5.5/mysys/my_read.c:50
        readbytes = <optimized out>
        save_count = 1048576
#3 0x00000000004038d1 in xb_stream_read_chunk (stream=stream@entry=0x2808260, chunk=chunk@entry=0x7fff9fecf150) at xbstream_read.c:212
        tmpbuf = "\001o\254\217\000\000\000\000\000\000\340\001\000\000\000"
        ptr = 0x7fff9fecf07a "\340\001"
        pathlen = <optimized out>
        tlen = <optimized out>
        tbytes = <optimized out>
        ullval = <optimized out>
        checksum_exp = 2410442497
        checksum = <optimized out>
        fd = 0
#4 0x0000000000402bb0 in mode_extract (argv=<optimized out>, argc=<optimized out>) at xbstream.c:385
        stream = 0x2808260
        res = <optimized out>
        chunk = {
          flags = 0 '\000',
          type = XB_CHUNK_TYPE_PAYLOAD,
          pathlen = 7,
          path = "bigfile\000S\177\000\000\365\020@\000\000\000\000\000x]\330\fS\177\000\000\340\002@\000\000\000\000\000\000\000\000\000\005\000\000\000o\003\000\000\001", '\000' <repeats 11 times>, "\210df\016S\177\000\000\360\362\354\237\377\177\000\000\020\301a\016S\177\000\000\030\363\354\237\377\177\000\000\060af\016S\177\000\000\001\000\000\000\000\000\000\000\204\346D\016S\177\000\000\000\000\000\000\000\000\000\000\020\301a\016S\177\000\000\005\000\000\000S\177\000\000\000\000\000\000\000\000\000\000\001\000\000\000S\177\000\000\060af\016S\177\000\000\000\000\000\000\000\000\000\000\272r\002\016S\177\000\000\320I\327\fS\177\000\000\000\334\021\rS\177\000\000\000\000\000\000\000\000\000\000"...,
          length = 1048576,
          offset = 31457280,
          data = 0x7f530e517010,
          checksum = 122782283
        }
        filehash = {
          key_offset = 0,
          key_length = 0,
          blength = 2,
          records = 1,
          flags = 0,
          array = {
            buffer = 0x28082e0 "\377\377\377\377",
            elements = 1,
            max_element = 16,
            alloc_increment = 32,
            size_of_element = 16
          },
          get_key = 0x402980 <get_file_entry_key>,
          free = 0x402af0 <file_entry_free>,
          charset = 0x841020 <my_charset_bin>
        }
        entry = <optimized out>
        ds_ctxt = 0x2808290
---Type <return> to cont...

Read more...

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers