Anyone know whats going on with PostgreSQL async_exec errors?

326 views
Skip to first unread message

zdennis

unread,
Nov 24, 2006, 1:37:51 PM11/24/06
to rubyonra...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Anyone know what's going on with ActiveRecord Edge and 1.2RC1 unit
tests. I get 13 failures from the "async_exec" method call. ie:

test_callback_rollback_in_save(ConcurrentTransactionTest):
ActiveRecord::StatementInvalid: NoMethodError: undefined method
`async_exec' for #<PGconn:0xb75a8754>: SET client_min_messages TO
'warning'


Is this a known failure that someone in core is working on or is this
functionality that needs to be fixed/implemented?

Zach
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFZzv/Myx0fW1d8G0RAkKNAJ9+SipEAuEVxy8imMloMEg1lBPyuwCaAqLn
3/xji8sEAUShT2jMMIWqo6U=
=QmmV
-----END PGP SIGNATURE-----

Michael Koziarski

unread,
Nov 24, 2006, 10:49:44 PM11/24/06
to rubyonra...@googlegroups.com
> Anyone know what's going on with ActiveRecord Edge and 1.2RC1 unit
> tests. I get 13 failures from the "async_exec" method call. ie:
>
> test_callback_rollback_in_save(ConcurrentTransactionTest):
> ActiveRecord::StatementInvalid: NoMethodError: undefined method
> `async_exec' for #<PGconn:0xb75a8754>: SET client_min_messages TO
> 'warning'
>
>
> Is this a known failure that someone in core is working on or is this
> functionality that needs to be fixed/implemented?


I'm not seeing any test failures like that, which db driver are you using?

--
Cheers

Koz

zdennis

unread,
Nov 24, 2006, 11:15:58 PM11/24/06
to rubyonra...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

This is running "rake test_postgresql", so it's using the postgresql db
adapter. Here are the errors I get from running "rake test_postgresql".
I am running Postgresql 8.1.4 with Rails trunk revision 5623.

Zach

- ------------

1) Error:


test_callback_rollback_in_save(ConcurrentTransactionTest):
ActiveRecord::StatementInvalid: NoMethodError: undefined method

`async_exec' for #<PGconn:0xb748b80c>: SET client_min_messages TO 'warning'

./test/../lib/active_record/connection_adapters/abstract_adapter.rb:122:in
`log'

./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:152:in
`execute'

./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:409:in
`configure_connection'

./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:59:in
`initialize'

./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:23:in
`postgresql_connection'

./test/../lib/active_record/connection_adapters/abstract/connection_specification.rb:252:in
`connection_without_query_cache='
./test/../lib/active_record/query_cache.rb:54:in `connection='

./test/../lib/active_record/connection_adapters/abstract/connection_specification.rb:220:in
`retrieve_connection'

./test/../lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in
`connection'
./test/../lib/active_record/fixtures.rb:247:in `create_fixtures'
./test/../lib/active_record/fixtures.rb:579:in `load_fixtures'
./test/../lib/active_record/fixtures.rb:533:in `setup_with_fixtures'
./test/../lib/active_record/fixtures.rb:561:in `setup'
./test/transactions_test.rb:154:in `setup'

2) Error:
test_failing_on_exception(ConcurrentTransactionTest):


ActiveRecord::StatementInvalid: NoMethodError: undefined method

`async_exec' for #<PGconn:0xb74756d8>: SET client_min_messages TO 'warning'

./test/../lib/active_record/connection_adapters/abstract_adapter.rb:122:in
`log'

./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:152:in
`execute'

./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:409:in
`configure_connection'

./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:59:in
`initialize'

./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:23:in
`postgresql_connection'

./test/../lib/active_record/connection_adapters/abstract/connection_specification.rb:252:in
`connection_without_query_cache='
./test/../lib/active_record/query_cache.rb:54:in `connection='

./test/../lib/active_record/connection_adapters/abstract/connection_specification.rb:220:in
`retrieve_connection'

./test/../lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in
`connection'
./test/../lib/active_record/fixtures.rb:247:in `create_fixtures'
./test/../lib/active_record/fixtures.rb:579:in `load_fixtures'
./test/../lib/active_record/fixtures.rb:533:in `setup_with_fixtures'
./test/../lib/active_record/fixtures.rb:561:in `setup'
./test/transactions_test.rb:154:in `setup'

3) Error:
test_failing_with_object_rollback(ConcurrentTransactionTest):


ActiveRecord::StatementInvalid: NoMethodError: undefined method

`async_exec' for #<PGconn:0xb745ebb8>: SET client_min_messages TO 'warning'

./test/../lib/active_record/connection_adapters/abstract_adapter.rb:122:in
`log'

./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:152:in
`execute'

./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:409:in
`configure_connection'

./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:59:in
`initialize'

./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:23:in
`postgresql_connection'

./test/../lib/active_record/connection_adapters/abstract/connection_specification.rb:252:in
`connection_without_query_cache='
./test/../lib/active_record/query_cache.rb:54:in `connection='

./test/../lib/active_record/connection_adapters/abstract/connection_specification.rb:220:in
`retrieve_connection'

./test/../lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in
`connection'
./test/../lib/active_record/fixtures.rb:247:in `create_fixtures'
./test/../lib/active_record/fixtures.rb:579:in `load_fixtures'
./test/../lib/active_record/fixtures.rb:533:in `setup_with_fixtures'
./test/../lib/active_record/fixtures.rb:561:in `setup'
./test/transactions_test.rb:154:in `setup'

4) Error:
test_nested_explicit_transactions(ConcurrentTransactionTest):


ActiveRecord::StatementInvalid: NoMethodError: undefined method

`async_exec' for #<PGconn:0xb7449c18>: SET client_min_messages TO 'warning'

./test/../lib/active_record/connection_adapters/abstract_adapter.rb:122:in
`log'

./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:152:in
`execute'

./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:409:in
`configure_connection'

./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:59:in
`initialize'

./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:23:in
`postgresql_connection'

./test/../lib/active_record/connection_adapters/abstract/connection_specification.rb:252:in
`connection_without_query_cache='
./test/../lib/active_record/query_cache.rb:54:in `connection='

./test/../lib/active_record/connection_adapters/abstract/connection_specification.rb:220:in
`retrieve_connection'

./test/../lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in
`connection'
./test/../lib/active_record/fixtures.rb:247:in `create_fixtures'
./test/../lib/active_record/fixtures.rb:579:in `load_fixtures'
./test/../lib/active_record/fixtures.rb:533:in `setup_with_fixtures'
./test/../lib/active_record/fixtures.rb:561:in `setup'
./test/transactions_test.rb:154:in `setup'

5) Error:
test_successful(ConcurrentTransactionTest):


ActiveRecord::StatementInvalid: NoMethodError: undefined method

`async_exec' for #<PGconn:0xb7439188>: SET client_min_messages TO 'warning'

./test/../lib/active_record/connection_adapters/abstract_adapter.rb:122:in
`log'

./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:152:in
`execute'

./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:409:in
`configure_connection'

./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:59:in
`initialize'

./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:23:in
`postgresql_connection'

./test/../lib/active_record/connection_adapters/abstract/connection_specification.rb:252:in
`connection_without_query_cache='
./test/../lib/active_record/query_cache.rb:54:in `connection='

./test/../lib/active_record/connection_adapters/abstract/connection_specification.rb:220:in
`retrieve_connection'

./test/../lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in
`connection'
./test/../lib/active_record/fixtures.rb:247:in `create_fixtures'
./test/../lib/active_record/fixtures.rb:579:in `load_fixtures'
./test/../lib/active_record/fixtures.rb:533:in `setup_with_fixtures'
./test/../lib/active_record/fixtures.rb:561:in `setup'
./test/transactions_test.rb:154:in `setup'

6) Error:
test_successful_with_instance_method(ConcurrentTransactionTest):


ActiveRecord::StatementInvalid: NoMethodError: undefined method

`async_exec' for #<PGconn:0xb7427744>: SET client_min_messages TO 'warning'

./test/../lib/active_record/connection_adapters/abstract_adapter.rb:122:in
`log'

./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:152:in
`execute'

./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:409:in
`configure_connection'

./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:59:in
`initialize'

./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:23:in
`postgresql_connection'

./test/../lib/active_record/connection_adapters/abstract/connection_specification.rb:252:in
`connection_without_query_cache='
./test/../lib/active_record/query_cache.rb:54:in `connection='

./test/../lib/active_record/connection_adapters/abstract/connection_specification.rb:220:in
`retrieve_connection'

./test/../lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in
`connection'
./test/../lib/active_record/fixtures.rb:247:in `create_fixtures'
./test/../lib/active_record/fixtures.rb:579:in `load_fixtures'
./test/../lib/active_record/fixtures.rb:533:in `setup_with_fixtures'
./test/../lib/active_record/fixtures.rb:561:in `setup'
./test/transactions_test.rb:154:in `setup'

7) Error:
test_successful_with_return(ConcurrentTransactionTest):


ActiveRecord::StatementInvalid: NoMethodError: undefined method

`async_exec' for #<PGconn:0xb7960444>: SET client_min_messages TO 'warning'

./test/../lib/active_record/connection_adapters/abstract_adapter.rb:122:in
`log'

./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:152:in
`execute'

./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:409:in
`configure_connection'

./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:59:in
`initialize'

./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:23:in
`postgresql_connection'

./test/../lib/active_record/connection_adapters/abstract/connection_specification.rb:252:in
`connection_without_query_cache='
./test/../lib/active_record/query_cache.rb:54:in `connection='

./test/../lib/active_record/connection_adapters/abstract/connection_specification.rb:220:in
`retrieve_connection'

./test/../lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in
`connection'
./test/../lib/active_record/fixtures.rb:247:in `create_fixtures'
./test/../lib/active_record/fixtures.rb:579:in `load_fixtures'
./test/../lib/active_record/fixtures.rb:533:in `setup_with_fixtures'
./test/../lib/active_record/fixtures.rb:561:in `setup'
./test/transactions_test.rb:154:in `setup'

8) Error:
test_transaction_isolation__read_committed(ConcurrentTransactionTest):


ActiveRecord::StatementInvalid: NoMethodError: undefined method

`async_exec' for #<PGconn:0xb77975a0>: SET client_min_messages TO 'warning'

./test/../lib/active_record/connection_adapters/abstract_adapter.rb:122:in
`log'

./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:152:in
`execute'

./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:409:in
`configure_connection'

./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:59:in
`initialize'

./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:23:in
`postgresql_connection'

./test/../lib/active_record/connection_adapters/abstract/connection_specification.rb:252:in
`connection_without_query_cache='
./test/../lib/active_record/query_cache.rb:54:in `connection='

./test/../lib/active_record/connection_adapters/abstract/connection_specification.rb:220:in
`retrieve_connection'

./test/../lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in
`connection'
./test/../lib/active_record/fixtures.rb:247:in `create_fixtures'
./test/../lib/active_record/fixtures.rb:579:in `load_fixtures'
./test/../lib/active_record/fixtures.rb:533:in `setup_with_fixtures'
./test/../lib/active_record/fixtures.rb:561:in `setup'
./test/transactions_test.rb:154:in `setup'

9) Error:
test_transaction_per_thread(ConcurrentTransactionTest):


ActiveRecord::StatementInvalid: NoMethodError: undefined method

`async_exec' for #<PGconn:0xb777ffcc>: SET client_min_messages TO 'warning'

./test/../lib/active_record/connection_adapters/abstract_adapter.rb:122:in
`log'

./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:152:in
`execute'

./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:409:in
`configure_connection'

./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:59:in
`initialize'

./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:23:in
`postgresql_connection'

./test/../lib/active_record/connection_adapters/abstract/connection_specification.rb:252:in
`connection_without_query_cache='
./test/../lib/active_record/query_cache.rb:54:in `connection='

./test/../lib/active_record/connection_adapters/abstract/connection_specification.rb:220:in
`retrieve_connection'

./test/../lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in
`connection'
./test/../lib/active_record/fixtures.rb:247:in `create_fixtures'
./test/../lib/active_record/fixtures.rb:579:in `load_fixtures'
./test/../lib/active_record/fixtures.rb:533:in `setup_with_fixtures'
./test/../lib/active_record/fixtures.rb:561:in `setup'
./test/transactions_test.rb:154:in `setup'

10) Error:
test_no_locks_no_wait(PessimisticLockingTest):


ActiveRecord::StatementInvalid: NoMethodError: undefined method

`async_exec' for #<PGconn:0xb7576244>: SET client_min_messages TO 'warning'

./test/../lib/active_record/connection_adapters/abstract_adapter.rb:122:in
`log'
./test/locking_test.rb:165:in `join'
./test/locking_test.rb:165:in `duel'
./test/locking_test.rb:134:in `test_no_locks_no_wait'

11) Failure:
test_sane_find_with_lock(PessimisticLockingTest)
[./test/locking_test.rb:111]:
Exception raised:
Class: <ActiveRecord::StatementInvalid>
Message: <"NoMethodError: undefined method `async_exec' for
#<PGconn:0xb749b2c0>: SET client_min_messages TO 'warning'">
- ---Backtrace---
./test/../lib/active_record/connection_adapters/abstract_adapter.rb:122:in
`log'
./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:152:in
`execute'
./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:409:in
`configure_connection'
./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:59:in
`initialize'
./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:23:in
`postgresql_connection'
./test/../lib/active_record/connection_adapters/abstract/connection_specification.rb:252:in
`connection_without_query_cache='
./test/../lib/active_record/query_cache.rb:54:in `connection='
./test/../lib/active_record/connection_adapters/abstract/connection_specification.rb:220:in
`retrieve_connection'
./test/../lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in
`connection'
./test/../lib/active_record/transactions.rb:95:in `transaction'
./test/locking_test.rb:112:in `test_sane_find_with_lock'
./test/locking_test.rb:111:in `test_sane_find_with_lock'
- ---------------

12) Failure:
test_sane_lock_method(PessimisticLockingTest) [./test/locking_test.rb:122]:
Exception raised:
Class: <ActiveRecord::StatementInvalid>
Message: <"NoMethodError: undefined method `async_exec' for
#<PGconn:0xb78a6b34>: SET client_min_messages TO 'warning'">
- ---Backtrace---
./test/../lib/active_record/connection_adapters/abstract_adapter.rb:122:in
`log'
./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:152:in
`execute'
./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:409:in
`configure_connection'
./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:59:in
`initialize'
./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:23:in
`postgresql_connection'
./test/../lib/active_record/connection_adapters/abstract/connection_specification.rb:252:in
`connection_without_query_cache='
./test/../lib/active_record/query_cache.rb:54:in `connection='
./test/../lib/active_record/connection_adapters/abstract/connection_specification.rb:220:in
`retrieve_connection'
./test/../lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in
`connection'
./test/../lib/active_record/transactions.rb:95:in `transaction'
./test/locking_test.rb:123:in `test_sane_lock_method'
./test/locking_test.rb:122:in `test_sane_lock_method'
- ---------------

13) Error:
test_second_lock_waits(PessimisticLockingTest):


ActiveRecord::StatementInvalid: NoMethodError: undefined method

`async_exec' for #<PGconn:0xb75c5d30>: SET client_min_messages TO 'warning'

./test/../lib/active_record/connection_adapters/abstract_adapter.rb:122:in
`log'
./test/locking_test.rb:165:in `join'
./test/locking_test.rb:165:in `duel'
./test/locking_test.rb:140:in `test_second_lock_waits'

./test/../lib/../../activesupport/lib/active_support/inflector.rb:162:in
`any?'
./test/locking_test.rb:139:in `test_second_lock_waits'

14) Error:
test_threaded_connections(ThreadedConnectionsTest):


ActiveRecord::StatementInvalid: NoMethodError: undefined method

`async_exec' for #<PGconn:0xb76a9224>: SET client_min_messages TO 'warning'

./test/../lib/active_record/connection_adapters/abstract_adapter.rb:122:in
`log'
./test/threaded_connections_test.rb:31:in `join'
./test/threaded_connections_test.rb:31:in `gather_connections'
./test/threaded_connections_test.rb:30:in `gather_connections'
./test/threaded_connections_test.rb:39:in `test_threaded_connections'

1032 tests, 3918 assertions, 2 failures, 12 errors
rake aborted!
Command failed with status (1): [/usr/local/lib/ruby-1.8.4/bin/ruby
- -Ilib:t...]

(See full trace by running task with --trace)

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFZ8N+Myx0fW1d8G0RAhOrAJ0RhnfYZDRfMqtl9TYLzfPd01RbEgCfUXe/
wzPLCY3V3zfONxSq40wYOoc=
=h4Hp
-----END PGP SIGNATURE-----

Michael Koziarski

unread,
Nov 25, 2006, 8:26:20 PM11/25/06
to rubyonra...@googlegroups.com
> This is running "rake test_postgresql", so it's using the postgresql db
> adapter. Here are the errors I get from running "rake test_postgresql".
> I am running Postgresql 8.1.4 with Rails trunk revision 5623.


Sure, but which postgresql driver? There are a bunch of them, and a
bunch of different versions. You should see some output like "Using
native PostgreSQL" when rake kicks off. ruby postgres v 0.7.1 on
tiger is working fine for me.


--
Cheers

Koz

Jeremy Kemper

unread,
Nov 25, 2006, 8:39:55 PM11/25/06
to rubyonra...@googlegroups.com
On 11/24/06, zdennis <zde...@mktec.com> wrote:
Anyone know what's going on with ActiveRecord Edge and 1.2RC1 unit
tests. I get 13 failures from the "async_exec" method call.  ie:

  test_callback_rollback_in_save(ConcurrentTransactionTest):
  ActiveRecord::StatementInvalid: NoMethodError: undefined method
  `async_exec' for #<PGconn:0xb75a8754>: SET client_min_messages TO
  'warning'


Is this a known failure that someone in core is working on or is this
functionality that needs to be fixed/implemented?

The C bindings emulate nonblocking API calls using async_exec; the postgres-pr driver does not. This is used for multithreaded Active Record by setting AR::Base.allow_concurrency = true. The pessimistic locking tests would deadlock without it.

This is not a regression, but it should be fixed.

jeremy

Hunter Hillegas

unread,
Nov 26, 2006, 4:29:37 AM11/26/06
to rubyonra...@googlegroups.com
So, I'm not entirely clear on this... From what you've written and
the source code, it sounds like in a production app (Mongrel), we
would be crazy to have allow_concurrency on false. Does turning it
off kill performance entirely, assuming we are using the C process
bindings?

Or do I just not understand how this stuff works"

Jeremy Kemper

unread,
Nov 26, 2006, 3:18:26 PM11/26/06
to rubyonra...@googlegroups.com
On 11/26/06, Hunter Hillegas <li...@lastonepicked.com> wrote:
So, I'm not entirely clear on this... From what you've written and
the source code, it sounds like in a production app (Mongrel), we
would be crazy to have allow_concurrency on false. Does turning it
off kill performance entirely, assuming we are using the C process
bindings?

Mongrel serializes Rails requests because Action Pack isn't thread-safe.

You'd turn on allow_concurrency in a multithreaded app using Active Record only.

jeremy

zdennis

unread,
Nov 27, 2006, 8:55:32 PM11/27/06
to rubyonra...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The pure ruby driver (postgres-pr) driver is the one giving the
async_exec errors. The native driver (postgres) gives no errors.

It is a non issue now. thanks,

Zach


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFa5cUMyx0fW1d8G0RAh26AJ9Gjgqydfm4xZUsjuHwlLZKAqPXgACeNrpq
o3NWZiMlgJtGDT8fEu+8Fjg=
=62OT
-----END PGP SIGNATURE-----

Reply all
Reply to author
Forward
0 new messages