Disco 的“无法解析工作事件:”是什么意思?错误是什么意思?
我正在尝试使用映射和化简函数来运行 Disco 作业,这些函数在使用 marshal
库通过 TCP 套接字传递后进行反序列化。 来解压它们
code = marshal.loads(data_from_tcp)
func = types.FunctionType(code, globals(), "func")
具体来说,我正在使用已经在同一系统上测试过的普通 Disco 作业(具有本地定义的函数) ,并且它们工作得很好。但是,当我使用新功能运行 Disco 作业时,作业不断失败,并且我不断收到错误消息 localhost 警告:[map:0] 无法解析工作事件:invalid_length
我搜索过文档中没有提及我可以找到“工作事件”或 invalid_length
。对源代码执行 grep 操作后,我发现了短语“无法解析工作事件:”的单个实例,特别是在文件 master/src/disco_worker.erl
中。我不熟悉 Erlang,也不知道它是如何工作的。
是什么导致了这个问题?我应该做点别的事情来规避它吗?
编辑:经过更多调试,我意识到这个错误与我在测试用例函数中使用 string.split() 方法有关。每当使用它时(即使对于不属于输入一部分的字符串),都会引发此错误。我已经验证该方法确实存在于对象上,但调用它似乎会引起问题。有什么想法吗?
编辑2:此外,任何使用 re.split 函数都可以达到相同的效果。
编辑3:似乎对映射函数中的输入字符串调用任何字符串函数都会产生相同的错误。
I'm trying to run a Disco job using map and reduce functions that are deserialized after being passed over a TCP socket using the marshal
library. Specifically, I'm unpacking them with
code = marshal.loads(data_from_tcp)
func = types.FunctionType(code, globals(), "func")
I've already tested plain Disco jobs (with locally defined functions) on the same system, and they work fine. However, when I run a Disco job with the new functions, the jobs keep failing and I keep getting the error message localhost WARNING: [map:0] Could not parse worker event: invalid_length
I've searched the documentation, and there is no mention that I could find of a "worker event", or of an invalid_length
. After doing a grep on the source code, I find a single instance of the phrase "Could not parse worker event:", specifically in the file master/src/disco_worker.erl
. I'm not familiar with Erlang, and have no idea how this works.
What is causing this problem? Should I do something else to circumvent it?
EDIT: After more debugging, I've realized that this error is tied to my use of the string.split() method inside my test-case function. Whenever it is used (even on strings that are not part of the input), this error is raised. I've verified that the method does exist on the object, but calling it seems to cause problems. Any thoughts?
EDIT 2: In addition, any use of the re.split function achieves the same effect.
EDIT 3: It appears that calling any string function on the input string in the map function creates this same error.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
就我而言,当我在映射函数中将某些内容打印到 sys.stderr 时(并且作业最终失败),总是会出现此警告。
工作协议的文档说:工作人员不应该向stderr,除非消息格式如下所述。 stdout 最初也被重定向到 stderr。
In my case this warning occured always when I printed something to sys.stderr in map function (and the job failed in the end).
The documentation to worker protocol says: Workers should not write anything to stderr, except messages formatted as described below. stdout is also initially redirected to stderr.