RejectedExecutionException和clojure并发 [英] RejectedExecutionException and clojure concurrency

查看:133
本文介绍了RejectedExecutionException和clojure并发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在将一些clojure代码部署到新服务器时,我遇到了 RejectedExecutionException 和无响应代理的问题。 REPL中的小示例如

In deploying some clojure code to a new server, I've been having problems with RejectedExecutionException and unresponsive agents. Small examples in the REPL such as

(pmap #(% %) (range 10))

似乎工作正常。但是,运行 pmap pcalls throw RejectedExecutionException 消耗一些(不同数量,但从不超过少数)的惰性seq。代理,相比之下,不要引发 RejectedExecutionException 。可以初始化代理,但不要执行使用发送发送分派的任何操作。

seem to work fine. However, running either pmap or pcalls throw RejectedExecutionExceptions after consuming some (a varying number, but never more than a handful) of a lazy seq. Agents, in comparison, don't throw RejectedExecutionException. The agents can be initialized but don't execute any actions dispatched with send or send-off.

代理的问题听起来很像描述的症状此处。此外,我不会在任何地方使用 shutdown-agents

The problem with agents sound much like the symptoms described here. Also, I'm not using shutdown-agents anywhere.

由于缺少可重复的示例,我先提出道歉。我对这个问题的主要困难是无法在其他机器上再现任何此行为。欢迎任何建议!

I apologize in advance for lack of reproducible example. My primary difficulty with this issue is not being able to reproduce any of this behavior on other machines. Any suggestions are welcome!

使用64位HotSpot Java 1.6.0_20和clojure 1.2.1。

Using 64-bit HotSpot Java 1.6.0_20 and clojure 1.2.1.

推荐答案

您可能使用的Leiningen版本已损坏,或有多个冲突版本的和/请参阅 https://github.com/technomancy/leiningen/issues/228 - 以下其中一个关于这个问题的许多讨论,以及我现在可以方便地找到的唯一一个。

You're probably using a version of Leiningen that is broken, or have multiple conflicting versions of it and/or swank. See https://github.com/technomancy/leiningen/issues/228 - one of the many discussions about this issue, and the only one I can conveniently find at the moment.

这篇关于RejectedExecutionException和clojure并发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆