cloudberry icon indicating copy to clipboard operation
cloudberry copied to clipboard

[Bug] [oe2309] server terminated abnormally when call plpython procedure

Open congxuebin opened this issue 1 year ago • 1 comments

Cloudberry Database version

PostgreSQL 14.4 (Cloudberry Database 1.5.5+dev.77.g5024c64f build 79256 commit:5024c64f)

What happened

Testcase python3/plpython_transaction failed.

test python3/plpython_schema      ... ok           90 ms
test python3/plpython_populate    ... ok          106 ms
test python3/plpython_test        ... ok           82 ms
test python3/plpython_do          ... ok           26 ms
test python3/plpython_global      ... ok           56 ms
test python3/plpython_import      ... ok           86 ms
test python3/plpython_spi         ... ok          291 ms
test python3/plpython_newline     ... ok           48 ms
test python3/plpython_void        ... ok           48 ms
test python3/plpython_call        ... ok           77 ms
test python3/plpython_params      ... ok           67 ms
test python3/plpython_setof       ... ok          117 ms
test python3/plpython_record      ... ok          103 ms
test python3/plpython_trigger     ... ok          393 ms
test python3/plpython_types       ... ok          226 ms
test python3/plpython_error       ... ok          141 ms
test python3/plpython_ereport     ... ok           83 ms
test python3/plpython_unicode     ... ok           83 ms
test python3/plpython_quote       ... ok           50 ms
test python3/plpython_composite   ... ok          129 ms
test python3/plpython_subtransaction ... ok          219 ms
test python3/plpython_transaction ... FAILED (test process exited with exit code 2)      311 ms
test python3/plpython_gpdb        ... ok           95 ms
test python3/plpython_drop        ... ok           83 ms

-- also not allowed if procedure is called from a function
CREATE FUNCTION transaction_test3() RETURNS int
LANGUAGE plpython3u
AS $$
plpy.execute("CALL transaction_test1()")
return 1
$$;
server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
connection to server was lost

What you think should happen instead

No response

How to reproduce

cd /code/cbdb_src/src/pl/plpython/ make installcheck

please note: simply issuing the ddl can not recreate the problem. But running all the test cases mentioned above can reproduce the issue all the time.

CREATE FUNCTION transaction_test3() RETURNS int
LANGUAGE plpython3u
AS $$
plpy.execute("CALL transaction_test1()")
return 1
$$;

Operating System

oe2309:x86_64

Anything else

No response

Are you willing to submit PR?

  • [ ] Yes, I am willing to submit a PR!

Code of Conduct

congxuebin avatar Jul 09 '24 07:07 congxuebin

The python version is 3.11.4

gfphoenix78 avatar Jul 30 '24 11:07 gfphoenix78