首页 \ 问答 \ Aerospike Java异步库似乎陷入困境(Aerospike Java Async library seems stuck)

Aerospike Java异步库似乎陷入困境(Aerospike Java Async library seems stuck)

我正在使用aeropike异步客户端执行udf。 客户端已初始化为: -

    try {
        asyncClientPolicy.maxThreads = 40;
        asyncClientPolicy.asyncMaxCommands = 20;
        asyncClientPolicy.maxSocketIdle = 13;
        asyncClientPolicy.asyncMaxCommandAction = MaxCommandAction.BLOCK;
        asyncClientPolicy.asyncSelectorThreads = 7;
        asyncClientPolicy.asyncTaskThreadPool = Executors.newFixedThreadPool(20, new ThreadFactory() {
            public final Thread newThread(Runnable runnable) {
                Thread thread = new Thread(runnable);
                thread.setDaemon(true);
                return thread;
            }
        });
    }

所以我有20个线程来处理回调。 过了一会儿,我看到我的程序没有做任何进展,表明死锁/饥饿。 Jstack给了我以下结果: -

java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <0x000000064048f338> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043)
    at java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:374)
    at com.aerospike.client.async.AsyncCluster$BlockBufferQueue.getByteBuffer(AsyncCluster.java:114)
    at com.aerospike.client.async.AsyncCluster.getByteBuffer(AsyncCluster.java:68)
    at com.aerospike.client.async.AsyncCommand.execute(AsyncCommand.java:59)
    at com.aerospike.client.async.AsyncClient.execute(AsyncClient.java:949)
    at main.java.labs.RuleEngineAerospikeConnection.updatePositiveSegmentsUDF(RuleEngineAerospikeConnection.java:217)
    at main.java.labs.Segment$ProductChecker.onSuccess(Segment.java:346)
    at com.aerospike.client.async.AsyncRead.onSuccess(AsyncRead.java:149)
    at com.aerospike.client.async.AsyncCommand.finish(AsyncCommand.java:293)
    at com.aerospike.client.async.AsyncSingleCommand.read(AsyncSingleCommand.java:59)
    at com.aerospike.client.async.AsyncCommand.run(AsyncCommand.java:261)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

execute命令中,我有20个处于等待状态的线程。 我是否对设置做错了,因为我希望客户端返回,即使我的UDF中有任何异常,如果存在无限循环会发生什么? 它会导致这种行为吗?


I am executing a udf using aeropike async client. The client has been initialized as:-

    try {
        asyncClientPolicy.maxThreads = 40;
        asyncClientPolicy.asyncMaxCommands = 20;
        asyncClientPolicy.maxSocketIdle = 13;
        asyncClientPolicy.asyncMaxCommandAction = MaxCommandAction.BLOCK;
        asyncClientPolicy.asyncSelectorThreads = 7;
        asyncClientPolicy.asyncTaskThreadPool = Executors.newFixedThreadPool(20, new ThreadFactory() {
            public final Thread newThread(Runnable runnable) {
                Thread thread = new Thread(runnable);
                thread.setDaemon(true);
                return thread;
            }
        });
    }

So I have 20 threads to handle the callbacks. After a while I see that my program is not doing any progress, indicating deadlock/starvation. Jstack gives me following result:-

java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <0x000000064048f338> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043)
    at java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:374)
    at com.aerospike.client.async.AsyncCluster$BlockBufferQueue.getByteBuffer(AsyncCluster.java:114)
    at com.aerospike.client.async.AsyncCluster.getByteBuffer(AsyncCluster.java:68)
    at com.aerospike.client.async.AsyncCommand.execute(AsyncCommand.java:59)
    at com.aerospike.client.async.AsyncClient.execute(AsyncClient.java:949)
    at main.java.labs.RuleEngineAerospikeConnection.updatePositiveSegmentsUDF(RuleEngineAerospikeConnection.java:217)
    at main.java.labs.Segment$ProductChecker.onSuccess(Segment.java:346)
    at com.aerospike.client.async.AsyncRead.onSuccess(AsyncRead.java:149)
    at com.aerospike.client.async.AsyncCommand.finish(AsyncCommand.java:293)
    at com.aerospike.client.async.AsyncSingleCommand.read(AsyncSingleCommand.java:59)
    at com.aerospike.client.async.AsyncCommand.run(AsyncCommand.java:261)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

I have exactly 20 threads in waiting state all on execute command. Am I doing something wrong with the setup, because I expect the client to return, even if there is any exception in my UDF, what happens if there is an infinite loop? could it lead to this behavior?


原文:https://stackoverflow.com/questions/45308357
更新时间:2024-03-03 14:03

相关问答

更多
  • 截至2016年2月 ,这些浏览器支持toBlob() Firefox 19 Chrome 50 IE10作为前缀msToBlob() 请注意,此答案最初是在2011年编写的。下面是原始答复/编辑。 toBlob()是新的,我不建议在消费者应用程序中使用它,除非您明确要求他们使用特定的浏览器(或者控制环境)。 toBlob()于5月12日添加,功能有限。 它不存在于Chrome每晚,Firefox每晚,也不存在IE9。 值得注意的是,Firefox确实有一个功能mozGetAsFile 甚至还没有关于将其添加 ...
  • toBlob方法是异步的,需要两个参数,回调函数和图像类型(可选第三个参数用于质量): void canvas.toBlob(callback,type,encoderOptions); 例 if (typeof canvas.toBlob !== "undefined") { canvas.toBlob(function(blob) { // send the blob to server etc. ... }, "image/jpeg", 0.75); } else if ...
  • 由于gengkev在上面的评论中暗示,看起来最好/唯一的方法是使用异步xhr2调用: var xhr = new XMLHttpRequest(); xhr.open('GET', 'blob:http%3A//your.blob.url.here', true); xhr.responseType = 'blob'; xhr.onload = function(e) { if (this.status == 200) { var myBlob = this.response; // m ...
  • 像这样的东西应该工作: &HttpClient.Execute(!"GET", &PdfUrl) &HttpClient.ToFile(&PdfPath) &Blob = &PdfPath 哪里: &HttpClient是一个HttpClient类型的变量 &PdfUrl是一个基于Url域的变量,并存储了pdf文件的URL。 &PdfPath是Character类型的变量,并存储文件将被临时复制的路径。 &Blob是Blob类型的变量。 编辑:名为BlobFile新数据类型将在下一版GeneXus中引入( ...
  • 我已经做了一些研究,因为我也在这个问题上进行了研究,我认为唯一的可能性是做XHR请求。 我认为它已经在这里讨论: 如何从一个对象URL获取文件或blob? 如果你有一个blob,你可以用FileReader将它转换成一个ArrayBuffer 。 但也许下面的工作也可以发挥作用: xhr.responseType = 'arraybuffer'; I've done some research because I'm also interessted in this question and I thin ...
  • 我很好奇你为什么试图在第二个代码片段中附加一个onload处理程序到URL中? 这不是您链接的帖子所接受的答案的一部分。 它看起来像第二个代码片段几乎可以工作,但有几件事情不合适。 我相信这会起作用: function fileSave1() { var canvas = document.getElementById('cSave'); canvas.toBlob(function(blob) { const anchor = document.createElement('a') ...
  • 下面使用的'MSApp.CreateFileFromStorageFile()`将起作用。 如果需要使用WinJS.xhr()发送文件,可以在xhrOptions中设置为数据。 var uri = new Windows.Foundation.Uri('ms-appx:///images/IMG_0550.jpg'); var self = this; Windows.Storage.StorageFile.getFileFromApplicationUriAsync(uri ...
  • 经过一番挖掘后,我们发现了https://code.google.com/p/chromium/issues/detail?id=294129 。 我的svg有一个(基于d3的图表),这就是我遇到这个问题的原因。 使用数据uri而不是从blob加载svg解决了我的问题 After some digging came across https://code.google.com/p/chromium/issues/detail?id=294129. My svg was havi ...
  • 您可以使用Promise构造函数,将Blob实例传递给resolve() ,在.then()访问Promise值 function getCanvasBlob(canvas) { return new Promise(function(resolve, reject) { canvas.toBlob(function(blob) { resolve(blob) }) }) } var canvasBlob = getCanvasBlob(canvas); canvas ...

相关文章

更多

最新问答

更多
  • 如何使用自由职业者帐户登录我的php网站?(How can I login into my php website using freelancer account? [closed])
  • 如何打破按钮上的生命周期循环(How to break do-while loop on button)
  • C#使用EF访问MVC上的部分类的自定义属性(C# access custom attributes of a partial class on MVC with EF)
  • 如何获得facebook app的publish_stream权限?(How to get publish_stream permissions for facebook app?)
  • 如何并排放置两个元件?(How to position two elements side by side?)
  • 在MySQL和/或多列中使用多个表用于Rails应用程序(Using multiple tables in MySQL and/or multiple columns for a Rails application)
  • 如何隐藏谷歌地图上的登录按钮?(How to hide the Sign in button from Google maps?)
  • Mysql左连接旋转90°表(Mysql Left join rotate 90° table)
  • 带有ImageMagick和许多图像的GIF动画(GIF animation with ImageMagick and many images)
  • 电脑高中毕业学习去哪里培训
  • 电脑系统专业就业状况如何啊?
  • IEnumerable linq表达式(IEnumerable linq expressions)
  • 如何在Spring测试中连接依赖关系(How to wire dependencies in Spring tests)
  • Solr可以在没有Lucene的情况下运行吗?(Can Solr run without Lucene?)
  • 如何保证Task在当前线程上同步运行?(How to guarantee that a Task runs synchronously on the current thread?)
  • 在保持每列的类的同时向数据框添加行(Adding row to data frame while maintaining the class of each column)
  • 的?(The ? marks in emacs/haskell and ghc mode)
  • 一个线程可以调用SuspendThread传递自己的线程ID吗?(Can a thread call SuspendThread passing its own thread ID?)
  • 延迟socket.io响应,并“警告 - websocket连接无效”(Delayed socket.io response, and “warn - websocket connection invalid”)
  • 悬停时的图像转换(Image transition on hover)
  • IIS 7.5仅显示homecontroller(IIS 7.5 only shows homecontroller)
  • 没有JavaScript的复选框“关闭”值(Checkbox 'off' value without JavaScript)
  • java分布式框架有哪些
  • Python:填写表单并点击按钮确认[关闭](Python: fill out a form and confirm with a button click [closed])
  • PHP将文件链接到根文件目录(PHP Linking Files to Root File Directory)
  • 我如何删除ListView中的项目?(How I can remove a item in my ListView?)
  • 您是否必须为TFS(云)中的每个BUG创建一个TASK以跟踪时间?(Do you have to create a TASK for every BUG in TFS (Cloud) to track time?)
  • typoscript TMENU ATagParams小写(typoscript TMENU ATagParams lowercase)
  • 武陟会计培训类的学校哪个好点?
  • 从链接中删除文本修饰(Remove text decoration from links)