omniti-labs / pg_amqp

AMQP Support for Postgres
https://labs.omniti.com/labs/pg_amqp
207 stars 63 forks source link

Should retry write for EINTR #16

Open j16sdiz opened 8 years ago

j16sdiz commented 8 years ago

I have got these error in my postgresql.log:

WARNING:  amqp could not commit tx mode on broker 1, reply_type=2, library_errno=4

errno 4 is "EINTR 4 Interrupted system call"

keithf4 commented 8 years ago

In all honesty, I'm pretty new at coding in C. Your patch to add more info to the warning messages seemed to work ok for me, so I incorporated it into an update. Right now I'm not quite sure how to go about debugging or fixing your issue.

j16sdiz commented 8 years ago

The code in PR #17 should work when standalone. But I have no idea how this interacts with postgres' signal handling. Might have bad interaction with pg_cancel_backend and friends -- i am just not sure.

If this don't work, we need a backend process to handle that reliably..

keithf4 commented 8 years ago

This should be fixed with the new librabbitmq library in the 0.5.0_dev branch. Please test.