Skip to content

write_row busy loop #255

@jerch

Description

@jerch

Found some weird behavior in version 3.0.10 (in both C and python variant, installed from pip).

This seems never to return, it sticks at 100% python CPU with no postgres activity:

def provoke(conn):
    txt = '\\' * 536870883
    c = conn.cursor()
    c.execute('create temporary table ttt(t1 text, t2 text, t3 text, t4 text, t5 text)')
    with c.copy('COPY ttt (t1,t2) FROM STDIN') as copy:
        copy.write_row([txt] * 2)
    c.execute('select length(t1), length(t2), length(t3) from ttt')
    print(c.fetchall())
    c.execute('drop table ttt')
provoke(connection)

Have not yet further debugged, maybe some sort of busy loop in text escaping solely on python side. The value size was chosen for typical postgres limits, which should raise here, but it never gets to postgres side of things.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions