forked from goodboy/tractor
				
			Don't enter debug on closed resource errors
							parent
							
								
									98bbf8e0df
								
							
						
					
					
						commit
						12f987514d
					
				| 
						 | 
					@ -197,9 +197,11 @@ async def _invoke(
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # TODO: maybe we'll want differnet "levels" of debugging
 | 
					        # TODO: maybe we'll want differnet "levels" of debugging
 | 
				
			||||||
        # eventualy such as ('app', 'supervisory', 'runtime') ?
 | 
					        # eventualy such as ('app', 'supervisory', 'runtime') ?
 | 
				
			||||||
        if not isinstance(err, trio.ClosedResourceError) and (
 | 
					        if (
 | 
				
			||||||
            not is_multi_cancelled(err)) and (
 | 
					            not is_multi_cancelled(err) and (
 | 
				
			||||||
            not isinstance(err, ContextCancelled)
 | 
					                not isinstance(err, ContextCancelled) or
 | 
				
			||||||
 | 
					                (isinstance(err, ContextCancelled) and ctx._cancel_called)
 | 
				
			||||||
 | 
					            )
 | 
				
			||||||
        ):
 | 
					        ):
 | 
				
			||||||
            # XXX: is there any case where we'll want to debug IPC
 | 
					            # XXX: is there any case where we'll want to debug IPC
 | 
				
			||||||
            # disconnects? I can't think of a reason that inspecting
 | 
					            # disconnects? I can't think of a reason that inspecting
 | 
				
			||||||
| 
						 | 
					@ -443,7 +445,7 @@ class Actor:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        chans = self._peers[uid]
 | 
					        chans = self._peers[uid]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # TODO: re-use channels for new connections instead 
 | 
					        # TODO: re-use channels for new connections instead
 | 
				
			||||||
        # of always new ones; will require changing all the
 | 
					        # of always new ones; will require changing all the
 | 
				
			||||||
        # discovery funcs
 | 
					        # discovery funcs
 | 
				
			||||||
        if chans:
 | 
					        if chans:
 | 
				
			||||||
| 
						 | 
					@ -519,10 +521,10 @@ class Actor:
 | 
				
			||||||
        send_chan, recv_chan = self._cids2qs[(chan.uid, cid)]
 | 
					        send_chan, recv_chan = self._cids2qs[(chan.uid, cid)]
 | 
				
			||||||
        assert send_chan.cid == cid  # type: ignore
 | 
					        assert send_chan.cid == cid  # type: ignore
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if 'error' in msg:
 | 
					        # if 'error' in msg:
 | 
				
			||||||
            ctx = getattr(recv_chan, '_ctx', None)
 | 
					        #     ctx = getattr(recv_chan, '_ctx', None)
 | 
				
			||||||
            # if ctx:
 | 
					        #     if ctx:
 | 
				
			||||||
            #     ctx._error_from_remote_msg(msg)
 | 
					        #         ctx._error_from_remote_msg(msg)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        #     log.debug(f"{send_chan} was terminated at remote end")
 | 
					        #     log.debug(f"{send_chan} was terminated at remote end")
 | 
				
			||||||
        #     # indicate to consumer that far end has stopped
 | 
					        #     # indicate to consumer that far end has stopped
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue