We have a Merb app, but it's a bin/rake task that's running. No
forking within the rake task, but it is a few green threads running,
which should be sleeping more often than not. One thought is a green
thread might fail to yield politely. But that would be ok if it just
caused a single DB query to timeout and I could then recover.
We actually run two of the tasks at overlapping times on the same
machine in separate directories and separate environments, though
using the same DB uri.
A stack trace is:
:exception: !ruby/exception:DataObjects::SQLError
message: Commands out of sync; you can''t run this command
now
:backtrace:
/mnt/indexer/framework/gems/gems/dm-core-0.10.1/lib/dm-core/adapters/
data_objects_adapter.rb:88:in `execute_reader''
/mnt/indexer/framework/gems/gems/dm-core-0.10.1/lib/dm-core/adapters/
data_objects_adapter.rb:88:in `read''
/mnt/indexer/framework/gems/gems/dm-core-0.10.1/lib/dm-core/adapters/
data_objects_adapter.rb:266:in `with_connection''
/mnt/indexer/framework/gems/gems/dm-core-0.10.1/lib/dm-core/adapters/
data_objects_adapter.rb:84:in `read''
/mnt/indexer/framework/gems/gems/dm-core-0.10.1/lib/dm-core/
repository.rb:141:in `read''
/mnt/indexer/framework/gems/gems/dm-core-0.10.1/lib/dm-core/
collection.rb:1001:in `lazy_load''
/mnt/indexer/framework/gems/gems/extlib-0.9.14/lib/extlib/
lazy_array.rb:451:in `map''
... in my app below
It then fails again on a write
/mnt/indexer/framework/gems/gems/dm-core-0.10.1/lib/dm-core/adapters/
data_objects_adapter.rb:162:in `execute_non_query'
- /mnt/indexer/framework/gems/gems/dm-core-0.10.1/lib/dm-core/
adapters/data_objects_adapter.rb:162:in `execute'
- /mnt/indexer/framework/gems/gems/dm-core-0.10.1/lib/dm-core/
adapters/data_objects_adapter.rb:266:in `with_connection'
- /mnt/indexer/framework/gems/gems/dm-core-0.10.1/lib/dm-core/
adapters/data_objects_adapter.rb:160:in `execute'
- /mnt/indexer/framework/gems/gems/dm-core-0.10.1/lib/dm-core/
adapters/data_objects_adapter.rb:134:in `update'
- /mnt/indexer/framework/gems/gems/dm-core-0.10.1/lib/dm-core/
repository.rb:159:in `update'
- /mnt/indexer/framework/gems/gems/dm-core-0.10.1/lib/dm-core/
resource.rb:841:in `_update'
- /mnt/indexer/framework/gems/gems/dm-core-0.10.1/lib/dm-core/
resource.rb:631:in `hookable__update_hook_nan_before_advised'
- /mnt/indexer/framework/gems/gems/extlib-0.9.14/lib/extlib/
hook.rb:299:in `update_hook'
- /mnt/indexer/framework/gems/gems/extlib-0.9.14/lib/extlib/
hook.rb:297:in `catch'
- /mnt/indexer/framework/gems/gems/extlib-0.9.14/lib/extlib/
hook.rb:297:in `update_hook'
- /mnt/indexer/framework/gems/gems/dm-core-0.10.1/lib/dm-core/
resource.rb:554:in `save_self'
- /mnt/indexer/framework/gems/gems/dm-validations-0.10.1/lib/dm-
validations.rb:55:in `save_self'
- /mnt/indexer/framework/gems/gems/dm-core-0.10.1/lib/dm-core/
resource.rb:343:in `save'
- /mnt/indexer/framework/gems/gems/dm-validations-0.10.1/lib/dm-
validations.rb:48:in `save'
- /mnt/indexer/framework/gems/gems/dm-validations-0.10.1/lib/dm-
validations/support/context.rb:29:in `validation_context'
- /mnt/indexer/framework/gems/gems/dm-validations-0.10.1/lib/dm-
validations.rb:48:in `save'
- /mnt/indexer/framework/gems/gems/dm-core-0.10.1/lib/dm-core/
resource.rb:316:in `update'
- /mnt/indexer/framework/gems/gems/dm-validations-0.10.1/lib/dm-
validations.rb:61:in `update'
- /mnt/indexer/framework/gems/gems/dm-validations-0.10.1/lib/dm-
validations/support/context.rb:29:in `validation_context'
- /mnt/indexer/framework/gems/gems/dm-validations-0.10.1/lib/dm-
validations.rb:61:in `update'
... in my app below
Thanks,
Gary
On Nov 3, 10:19 am, Dirkjan Bussink <[email protected]> wrote:
> What kind of application do you have where you get these errors? Is
> this in a Merb, Sinatra or another app? Are you doing things
> multithreaded or not?
>
> And do you have a strack trace to see where it occurs? Whether it's
> always when reading data, when writing, both or any other regularity
> that you can find.
>
> One idea that springs to mind is that perhaps forking could be an
> issue. If a main process connects to the database and then the child
> processes fork, they could be sharing a connection perhaps and run
> queries on that out of sync.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"DataMapper" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/datamapper?hl=en
-~----------~----~----~----~------~----~------~--~---