Confused by correct ActiveJob use

41 views
Skip to first unread message

Francesco Malvezzi

unread,
Mar 19, 2015, 11:03:03 AM3/19/15
to rubyonra...@googlegroups.com
I am confused by the ActiveJob (sucker_punch) interaction with ActiveRecords.

After a while the application is running, logs start receiving:

[...]
E, [2015-03-19T12:48:20.770265 #31422] ERROR -- : Actor crashed!
ActiveJob::DeserializationError: Error while trying to deserialize arguments: OCIError: ORA-03135: connessione interrotta
ID processo: 16538
[...]

It looks the actor is trying to use a stale ActiveRecord session.

Apart from the actor, ActiveRecords works fine in the application. Connection to db is ok.

Is it possibile actors are "detached" from application so they are unable to check out a new connection from the pool?

How can I avoid that?

Pointers are greatly appreciated,

thank you,

Francesco

Francesco Malvezzi

unread,
Mar 21, 2015, 10:37:28 AM3/21/15
to rubyonra...@googlegroups.com
I found useful the following:

1) wrap ActiveRecord calls in a
ActiveRecord::Base.connection_pool.with_connection
block.
It was written on the sucker_punch documentation;

2) while invoking active_job tasks, avoid using GlobalID.
I feel the deserialization of the activerecord object was the casus belli of the failure I experienced.

Francesco

Reply all
Reply to author
Forward
0 new messages