[Home]

Summary:ASTERISK-24041: deadlock when cdr_pgsql fails to post CDR due to PGSQL connection failure
Reporter:Gergely Dömsödi (doome)Labels:
Date Opened:2014-07-14 07:53:29Date Closed:2018-01-02 08:30:35.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:CDR/cdr_pgsql
Versions:1.8.28.0 Frequency of
Occurrence
Occasional
Related
Issues:
Environment:Attachments:( 0) backtrace-threads.txt
( 1) cdr_pgsql.conf
( 2) cdr.conf
( 3) core-channels.txt
( 4) core-locks.txt
( 5) core-threads.txt
( 6) main-cut.log
Description:On our production system SIP channels got stuck in asterisk. This happened 1-2 times daily on a system which is barely used. After a lot of trial-and-no-result, I managed to seemingly solve it by turning off the posting of CDRs to PGSQL, hence the assumption that it is somehow related to cdr_pgsql.

In the logs, we could see a SIP hangup coming in from one leg of the channel, the UserEvent fireing which we have in the "h" extension, but the asterisk didn't send the BYE event to the other participant.

Unfortunately I couldn't reproduce the issue on a non-production system, but I managed to get a lot of debug log from the production server.

Comments:By: Gergely Dömsödi (doome) 2014-07-14 08:01:39.292-0500

Attached all debug files. These where created when the channel got stuck in asterisk.

The hangup from one of the participant comes in at 10:51:37 in the main-cut log. The other files were created at 10:51:55, a little while after the lock happened.

There seems to be no way to remove the stuck channel from asterisk.

Right now, we use this system with the CDR turned off, but if more logs or tests are required, I think I could reproduce the issue by turning it back again.

By: Rusty Newton (rnewton) 2014-07-18 09:13:45.098-0500

Please post cdr_pgsql and backend configuration on here as well to increase the odds to help others troubleshoot or identify if their issue is the same.

Note that cdr_pgsql is [extended support|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Module+Support+States], meaning it is supported by the community and not the core developers. Response time to the issue may reflect that.

In the meantime, if you need to push CDR to PostgresQL you might try cdr_adaptive_odbc and use ODBC to get there, which is core supported.

By: Gergely Dömsödi (doome) 2014-07-21 01:34:27.010-0500

CDR, and backend config attached.

By: Rusty Newton (rnewton) 2014-08-04 18:22:36.725-0500

Thanks!

By: Joshua C. Colp (jcolp) 2017-12-18 09:49:01.317-0600

Have you experienced this problem in current supported Asterisk? If so what version of the postgresql client library is in use?

By: Asterisk Team (asteriskteam) 2018-01-02 08:30:35.852-0600

Suspended due to lack of activity. This issue will be automatically re-opened if the reporter posts a comment. If you are not the reporter and would like this re-opened please create a new issue instead. If the new issue is related to this one a link will be created during the triage process. Further information on issue tracker usage can be found in the Asterisk Issue Guidlines [1].
[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines