0

我在使用 Ruby on Rails 的应用程序中集成了 Vertical Response API。

我在使用将列表成员附加到 VR API 时遇到问题 vr_obj_new.appendFileToList(sid, lid, csv_data)

每当我调用此方法时,都会收到“Execution Expired”错误。我尝试上传包含大约 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
4

1 回答 1

0

现在这个问题已经解决了。这是由于使用 Vertical Response API 时的电子邮件冲突。让我试着解释一下。

由于我使用的是垂直响应 (VR) 的合作伙伴 API,它使用子帐户(基于模拟用户字段)来执行登录、创建列表、创建电子邮件等操作,因此登录 VR 需要主登录电子邮件(用户名)和模拟用户电子邮件。

当我在 VR 登录方法中保留相同的主登录电子邮件和模拟用户电子邮件的值时,问题就出现了。因此,在使用 VR Partner API 时,我们应该保留两封电子邮件的不同值。这将解决问题。

于 2013-10-15T06:32:32.970 回答