我已经在使用Ruby on Rails的应用程序中集成了垂直响应API。
我在使用vr_obj_new.appendFileToList(sid, lid, csv_data)将列表的成员追加到VR接口时遇到问题
每当我调用此方法时,我都会收到“Execution Expired”错误。我试图上传一个包含大约100,000条记录的列表。由于CSV文件很大,所以我发送了多个CSV文件,其中包含20000、10000甚至5,000条记录,但我仍然收到相同的错误。我得到的一个主要发现是,它在我的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发布于 2013-10-15 14:32:33
现在问题已经解决了。这是由于使用垂直响应API时的电子邮件冲突造成的。让我试着解释一下。
由于我正在使用垂直响应( VR )的合作伙伴应用程序接口,它使用子帐户(基于模拟用户字段)来执行登录、CreateList、CreateEmail等操作,因此要登录到VR,它需要主登录电子邮件(用户名)和模拟用户电子邮件。
当我在VR登录方法中保持主登录电子邮件和模拟用户电子邮件的值相同时,问题就出现了。因此,当使用VR合作伙伴API时,我们应该保留两个电子邮件的不同值。这将解决问题。
https://stackoverflow.com/questions/19007944
复制相似问题