2013-09-25 47 views
0

我已经在我的应用程序中使用Ruby on Rails集成了垂直响应API。执行过程与垂直响应API

我同时使用 vr_obj_new.appendFileToList(sid, lid, csv_data)

到VR API列表的追加成员每当我把这种方法面临的一个问题,我收到“执行过期”的错误。我试图上传一个包含大约100,000条记录的列表。由于CSV文件很大,所以我发送了包含20000,10000甚至5000条记录的多个CSV文件,但我仍然收到相同的错误。我得到的一个主要发现是,在生产环境中发生此错误时,它在我的DEV环境中工作正常。您可以在附加的文本文件中找到更多关于错误的详细信息。

按我分析,这似乎是对生产HTTPClient超时我所设定的条件的问题:

client = HTTPClient.new 
client.receive_timeout = 40000 

但它并没有正常工作。

确切的错误如下:

execution expired 
/var/lib/gems/1.8/gems/httpclient-2.3.4.1/lib/httpclient/timeout.rb:43:in `fill_rbuff' 
/usr/lib/ruby/1.8/openssl/buffering.rb:107:in `gets' 
/var/lib/gems/1.8/gems/httpclient-2.3.4.1/lib/httpclient/session.rb:352:in `gets' 
/var/lib/gems/1.8/gems/httpclient-2.3.4.1/lib/httpclient/session.rb:879:in `parse_header' 
/var/lib/gems/1.8/gems/httpclient-2.3.4.1/lib/httpclient/timeout.rb:131:in `timeout' 
/var/lib/gems/1.8/gems/httpclient-2.3.4.1/lib/httpclient/session.rb:875:in `parse_header' 
/var/lib/gems/1.8/gems/httpclient-2.3.4.1/lib/httpclient/session.rb:858:in `read_header' 
/var/lib/gems/1.8/gems/httpclient-2.3.4.1/lib/httpclient/session.rb:667:in `get_header' 
/var/lib/gems/1.8/gems/httpclient-2.3.4.1/lib/httpclient.rb:1137:in `do_get_header' 
/var/lib/gems/1.8/gems/httpclient-2.3.4.1/lib/httpclient.rb:1086:in `do_get_block' 
/var/lib/gems/1.8/gems/httpclient-2.3.4.1/lib/httpclient.rb:887:in `do_request' 
/var/lib/gems/1.8/gems/httpclient-2.3.4.1/lib/httpclient.rb:981:in `protect_keep_alive_disconnected' 
/var/lib/gems/1.8/gems/httpclient-2.3.4.1/lib/httpclient.rb:886:in `do_request' 
/var/lib/gems/1.8/gems/httpclient-2.3.4.1/lib/httpclient.rb:774:in `request' 
/var/lib/gems/1.8/gems/httpclient-2.3.4.1/lib/httpclient.rb:684:in `post' 
/var/lib/gems/1.8/gems/soap4r-1.5.8/lib/soap/streamHandler.rb:238:in `send_post' 
/var/lib/gems/1.8/gems/soap4r-1.5.8/lib/soap/streamHandler.rb:172:in `send' 
/var/lib/gems/1.8/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:179:in `route' 
/var/lib/gems/1.8/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:143:in `call' 
/var/lib/gems/1.8/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:181:in `call' 
(eval):6:in `appendFileToList' 
./lib/vertical_response.rb:102:in `appendFileToList' 
/ebs/data/www/Whelan-Project-Manager/app/models/email.rb:74:in `append_list_to_vr' 
/ebs/data/www/Whelan-Project-Manager/app/models/email.rb:71:in `each' 
/ebs/data/www/Whelan-Project-Manager/app/models/email.rb:71:in `append_list_to_vr' 
/var/lib/gems/1.8/gems/delayed_job-2.1.4/lib/delayed/performable_method.rb:20:in `send' 
/var/lib/gems/1.8/gems/delayed_job-2.1.4/lib/delayed/performable_method.rb:20:in `perform' 
/var/lib/gems/1.8/gems/delayed_job-2.1.4/lib/delayed/backend/base.rb:87:in `invoke_job_without_newrelic_transaction_trace' 
(eval):3:in `invoke_job' 
/var/lib/gems/1.8/gems/newrelic_rpm-3.3.0/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:253:in `perform_action_with_newrelic_trace' 
/var/lib/gems/1.8/gems/newrelic_rpm-3.3.0/lib/new_relic/agent/method_tracer.rb:242:in `trace_execution_scoped' 
/var/lib/gems/1.8/gems/newrelic_rpm-3.3.0/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:248:in `perform_action_with_newrelic_trace' 
(eval):2:in `invoke_job' 
/var/lib/gems/1.8/gems/delayed_job-2.1.4/lib/delayed/worker.rb:120:in `run' 
/usr/lib/ruby/1.8/timeout.rb:67:in `timeout' 
/var/lib/gems/1.8/gems/delayed_job-2.1.4/lib/delayed/worker.rb:120:in `run' 
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime' 
/var/lib/gems/1.8/gems/delayed_job-2.1.4/lib/delayed/worker.rb:119:in `run' 
/var/lib/gems/1.8/gems/delayed_job-2.1.4/lib/delayed/worker.rb:177:in `reserve_and_run_one_job' 
/var/lib/gems/1.8/gems/delayed_job-2.1.4/lib/delayed/worker.rb:104:in `work_off' 
/var/lib/gems/1.8/gems/delayed_job-2.1.4/lib/delayed/worker.rb:103:in `times' 
/var/lib/gems/1.8/gems/delayed_job-2.1.4/lib/delayed/worker.rb:103:in `work_off' 
/var/lib/gems/1.8/gems/delayed_job-2.1.4/lib/delayed/worker.rb:78:in `start' 
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime' 
/var/lib/gems/1.8/gems/delayed_job-2.1.4/lib/delayed/worker.rb:77:in `start' 
/var/lib/gems/1.8/gems/delayed_job-2.1.4/lib/delayed/worker.rb:74:in `loop' 
/var/lib/gems/1.8/gems/delayed_job-2.1.4/lib/delayed/worker.rb:74:in `start' 
/var/lib/gems/1.8/gems/delayed_job-2.1.4/lib/delayed/command.rb:104:in `run' 
/var/lib/gems/1.8/gems/delayed_job-2.1.4/lib/delayed/command.rb:83:in `run_process' 
/var/lib/gems/1.8/gems/daemons-1.1.9/lib/daemons/application.rb:255:in `call' 
/var/lib/gems/1.8/gems/daemons-1.1.9/lib/daemons/application.rb:255:in `start_proc' 
/var/lib/gems/1.8/gems/daemons-1.1.9/lib/daemons/daemonize.rb:82:in `call' 
/var/lib/gems/1.8/gems/daemons-1.1.9/lib/daemons/daemonize.rb:82:in `call_as_daemon' 
/var/lib/gems/1.8/gems/daemons-1.1.9/lib/daemons/application.rb:259:in `start_proc' 
/var/lib/gems/1.8/gems/daemons-1.1.9/lib/daemons/application.rb:296:in `start' 
/var/lib/gems/1.8/gems/daemons-1.1.9/lib/daemons/application_group.rb:159:in `start_all' 
/var/lib/gems/1.8/gems/daemons-1.1.9/lib/daemons/application_group.rb:158:in `fork' 
/var/lib/gems/1.8/gems/daemons-1.1.9/lib/daemons/application_group.rb:158:in `start_all' 
/var/lib/gems/1.8/gems/daemons-1.1.9/lib/daemons/application_group.rb:157:in `each' 
/var/lib/gems/1.8/gems/daemons-1.1.9/lib/daemons/application_group.rb:157:in `start_all' 
/var/lib/gems/1.8/gems/daemons-1.1.9/lib/daemons/controller.rb:80:in `run' 
/var/lib/gems/1.8/gems/daemons-1.1.9/lib/daemons.rb:197:in `run_proc' 
/var/lib/gems/1.8/gems/daemons-1.1.9/lib/daemons/cmdline.rb:109:in `call' 
/var/lib/gems/1.8/gems/daemons-1.1.9/lib/daemons/cmdline.rb:109:in `catch_exceptions' 
/var/lib/gems/1.8/gems/daemons-1.1.9/lib/daemons.rb:196:in `run_proc' 
/var/lib/gems/1.8/gems/delayed_job-2.1.4/lib/delayed/command.rb:81:in `run_process' 
/var/lib/gems/1.8/gems/delayed_job-2.1.4/lib/delayed/command.rb:75:in `daemonize' 
/var/lib/gems/1.8/gems/delayed_job-2.1.4/lib/delayed/command.rb:73:in `times' 
/var/lib/gems/1.8/gems/delayed_job-2.1.4/lib/delayed/command.rb:73:in `daemonize' 
script/delayed_job:5 

回答

0

的问题已经得到解决。这是由于使用垂直响应API时发生电子邮件冲突。让我试着解释一下。

由于我使用垂直响应(VR)的合作伙伴API,它使用一个子帐户(基于模拟用户字段)来执行诸如Login,CreateList,CreateEmail等的事情,因此登录到VR时需要主要登录电子邮件(用户名)和模拟用户电子邮件。

当我在VR登录方法中保留主登录电子邮件和模拟用户电子邮件的相同值时,问题出现在那里。因此,在使用VR合作伙伴API时,我们应该保留两个电子邮件的单独值。这将解决问题。