草庐IT

goldfish_pipe

全部标签

python 子进程: "write error: Broken pipe"

我在管道传输一个简单的subprocess.Popen时遇到问题。代码:importsubprocesscmd='catfile|sort-g-k3|head-20|cut-f2,3'%(pattern,file)p=subprocess.Popen(cmd,shell=True,stdout=subprocess.PIPE)forlineinp.stdout:print(line.decode().strip())文件的输出长度约为1000行:...sort:writefailed:standardoutput:Brokenpipesort:writeerror文件的输出长度>241

Python BaseHTTPServer,如何捕获/捕获 "broken pipe"错误?

我在Python中构建了一个短url翻译器引擎,我看到了大量“破损的管道”错误,我很好奇如何在使用BaseHTTPServer类时最好地捕获它。这不是完整的代码,但可以让您了解我目前所做的事情:fromBaseHTTPServerimportBaseHTTPRequestHandler,HTTPServerimportmemcacheclassclientThread(BaseHTTPRequestHandler):defdo_GET(self):content=Nonehttp_code,response_txt,long_url=\self.ag_trans_url(self.pa

python - Pandas :GroupBy .pipe() 与 .apply()

在pandasdocumentation的示例中关于GroupBy对象的新.pipe()方法,接受相同lambda的.apply()方法将返回相同的结果。In[195]:importnumpyasnpIn[196]:n=1000In[197]:df=pd.DataFrame({'Store':np.random.choice(['Store_1','Store_2'],n),.....:'Product':np.random.choice(['Product_1','Product_2','Product_3'],n),.....:'Revenue':(np.random.random

python - subprocess.call() 和 subprocess.Popen() 之间有什么区别使前者的 PIPE 安全性降低?

我已经查看了它们的文档。这个问题是由J.F.在这里的评论提示的:Retrievingtheoutputofsubprocess.call()subprocess.call()的当前Python文档说明以下关于将PIPE用于subprocess.call()的内容:NoteDonotusestdout=PIPEorstderr=PIPEwiththisfunction.ThechildprocesswillblockifitgeneratesenoughoutputtoapipetofilluptheOSpipebufferasthepipesarenotbeingreadfrom.Py

redis - redis cli中有pipe的概念吗?

在rediscli中,有时我想得到一个随机值,但是要做到这一点,我必须执行randomkey,并将结果复制为get的参数,有没有管道让我可以执行randomkey|将放在一行中以避免我复制? 最佳答案 CLI本身没有那个,但是操作系统-如果是*nix-为此提供了xargs:~$redis-cliFLUSHALLOK~$redis-cliSETfoobarOK~$redis-cliSETbazqazOK~$redis-cliRANDOMKEY|xargsredis-cliGET"qaz"~$redis-cliRANDOMKEY|xar

php - php 升级 pcntl_fork 后导致 "errno=32 Broken pipe"

我最近从php5.4.26升级到5.4.28,升级后出现此错误Notice:Unknown:sendof6bytesfailedwitherrno=32BrokenpipeinUnknownonline0每当我运行以下代码时:array(),'2'=>array(),);ini_set('display_errors',true);classRedisClass{private$redis;publicfunction__construct(){$this->redis=newRedis();$this->redis->connect('localhost',6379);}}$redi

java - spring boot redis 操作 throw broken pipe 错误

我们在springboot项目中使用了redis。运行一段时间后,redis操作可能会抛出brokenpipe错误,但有时会成功。重新启动服务将解决此问题,但这不是一个好主意。我说不出为什么会这样。似乎池中的某些redis连接不可用,但并未关闭并从池中逐出。我的问题是:导致管道破裂错误的可能原因是什么?如果长时间没有redis操作,池中的空闲连接会不会变得不可用?当发生断管错误时,连接是否会被关闭并从池中逐出?pom.xml:org.springframework.bootspring-boot-starter-data-redis应用程序.yml:spring:redis:datab

c# - 系统.IO.Exception : Pipe is broken

我有两个.NET应用程序,它们通过命名管道相互通信。第一次一切都很好,但是在发送第一条消息后,服务器将再次监听,WaitForConnection()方法抛出一个System.IO.Exception消息管道坏了。为什么我在这里得到这个异常(exception)?这是我第一次使用管道,但在过去使用套接字时,类似的模式对我有用。代码啊!服务器:usingSystem.IO.Pipes;staticvoidmain(){varpipe=newNamedPipeServerStream("pipename",PipeDirection.In);while(true){pipe.Listen(

jquery - 什么时候应该使用jQuery deferred的 "then"方法,什么时候应该使用 "pipe"方法?

jQuery的Deferred有两个函数可用于实现函数的异步链接:then()deferred.then(doneCallbacks,failCallbacks)Returns:DeferreddoneCallbacksAfunction,orarrayoffunctions,calledwhentheDeferredisresolved.failCallbacksAfunction,orarrayoffunctions,calledwhentheDeferredisrejected.pipe()deferred.pipe([doneFilter][,failFilter])Retur

go - 多次使用TCP连接返回 'broken pipe'错误

这个问题是关于go和它的net包的。我写了一个简单的tcp服务器处理一些RPC。客户端使用channet.Conn来管理客户端的所有tcp连接。服务器正在运行一个tcp监听器。代码如下:客户:packageserverimport("errors""log""net")vartcpPoolchannet.ConnfuncNewClient(connectionsint,addressstring){tcpPool=make(channet.Conn,connections)fori:=0;i>>>>>>>>>>>:",res)iferr!=nil{b[0]=ReErrorbreak}i