English 中文(简体)
肥料条件下的傲慢状况和重试?
原标题:Error conditions and retries in gearman?
  • 时间:2012-01-15 13:53:44
  •  标签:
  • gearman

Can someone guide me on how gearman does retries when exceptions are thrown or when errors occur?

I use the python gearman client in a Django app and my workers are initiated as a Django command. I read from this blog post that retries from error conditions are not straight forward and that it requires sys.exit from the worker side.

Has this been fixed to retry perhaps with sendFail or sendException? Also does gearman support retries with exponentials algorithm – say if an SMTP failure happens its retries after 2,4,8,16 seconds etc?

问题回答

根据我的理解,用具人采用非常“非我的生意”的做法,例如,除非工人坠毁,否则不会干预从事的工作。 任何成功/失败的信息都应由客户而不是服务器自己处理。

在地下工作方面,这意味着所有<代码>sendFail(>>/sendException(和其他send*(>)都针对客户,由客户决定是否重新从事工作。 这具有意义,因为有时你可能不需要再做工业。

在背景工作方面,所有<代码>的功能失去意义,因为没有客户会听取反馈意见。 因此,发送的信息只能被人忽略。 重新雇用的唯一条件是工人坠毁(可以通过复制<条码>exit(XX)的指令,其中<条码>XX为非零值)。 当然,这并不是你想要做的事,因为工人通常要从事长期工作,而不是在每次工作失败后必须重新开始的工作。

个人而言,我已经通过延长缺电动手门别类的方式解决了这一问题,我在那里拦截了<代码>send*(<>>/代码”功能的电话,然后亲自执行再工业机制。 基本上,我通过所有与工业有关的数据(最大数目的重试、已经翻新的时间)以及工作量,然后处理所有问题。 这是一个很麻烦的问题,但我理解为什么要这样工作——这只是允许你处理所有应用逻辑。

最后,关于以指数计时重新就业的能力(或该问题的任何时间)。 制片人有增加延迟工作的特点(SUBMIT_JOB_EPOCH,载于protocol 文件),但我不肯定其地位——PHP的延伸,而且我认为,Garde模块不支持它,而docs说它今后可以拆除。 但我的理解是,它目前是行之有效的——你刚刚需要向运载器提交原始袖珍要求,以便做到这一点(同时,在你方面也应执行成指数部分)。

然而,。 这一博客员额认为,SUBMIT_JOB_EPOCH的实施工作规模不大。 他使用Node.js和setout()来做工作,我看到其他人也使用不准确的用户代码<>at做同样的工作。 不管怎样,用具的人不会为你做。 它将侧重于可靠性,但将让你侧重于所有逻辑。





相关问题
Any way to access Gearman administration?

I want to be able to query a gearman server to determine how many instances of a worker I have running (basically I want to make sure that RunTaskA is available and RunTaskB is available if there are ...

Gearman Scheduler

Anybody have experience or thoughts on a scheduler to couple with a persistent Gearman queue? Obviously there s crontab available, but i d like some more functionality. We re looking at Java Quartz. ...

Python Daemon Subprocess not working at boot

I am attempting to write a python daemon that will launch at boot. The goal of the script is to receive a job from our gearman load balancing server and complete the job. I am using the python-...

Simulating Google Appengine s Task Queue with Gearman

One of the characteristics I love most about Google s Task Queue is its simplicity. More specifically, I love that it takes a URL and some parameters and then posts to that URL when the task queue is ...

Simple scalable work/message queue with delay

I need to set up a job/message queue with the option to set a delay for the task so that it s not picked up immediately by a free worker, but after a certain time (can vary from task to task). I ...

Stopping gearman workers nicely

I have a number of Gearman workers running constantly, saving things like records of user page views, etc. Occasionally, I ll update the PHP code that is used by the Gearman workers. In order to get ...

Why does this loop return 1 when using && instead of and ?

Riddle me this... in the while($row = mysql_fetch_assoc($result) and $runningOK) loop, if the PHP && operator is used in place of the and then mysql_fetch_assoc fails terribly and returns just ...

热门标签