oneway method call followed by _pyroRelease doesn't get called
See original GitHub issueWhen a oneway call is followed immediately by _pyroRelease
, the server method never gets called. This only occurs with communication over a unix domain socket and seems to be a regression from v5.8 to v5.9. This is an issue for instance when using the Proxy
as a context manager when the last call is a oneway call before leaving the context.
An example to reproduce this, adapted from examples/oneway/server2:
Server:
import time
import threading
from Pyro5.api import expose, oneway, behavior, serve, Daemon
@expose
@behavior("single")
class Server(object):
def __init__(self):
self.counter = 0
@oneway
def increment_oneway(self):
print("oneway call executing in thread", threading.get_ident())
time.sleep(0.5)
self.counter += 1
def increment(self):
time.sleep(0.5)
self.counter += 1
def getcount(self):
return self.counter
with Daemon(unixsocket='/Users/samschott/Desktop/example.sock') as daemon:
daemon.register(Server, "example")
daemon.requestLoop()
Client:
This won’t work:
from Pyro5.api import Proxy
with Proxy("PYRO:example@./u:/Users/samschott/Desktop/example.sock") as serv:
serv.increment_oneway()
But giving it some time does work:
import time
from Pyro5.api import Proxy
with Proxy("PYRO:example@./u:/Users/samschott/Desktop/example.sock") as serv:
serv.increment_oneway()
time.sleep(0.1)
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (7 by maintainers)
Top Results From Across the Web
Tips & Tricks — Pyro 5.14 documentation - Read the Docs
Possible ways to break a cycle are to use a oneway call somewhere in the chain or set an COMMTIMEOUT so that after...
Read more >PYRO - Features and Guidelines - PythonHosted.org
Any method calls that use mobile code must be normal calls. If you want to use oneway calls, first use a normal call...
Read more >With Pyro coming with 4.0. That means all of the things ...
Nothing's stopping you from calling in a friend halfway through your mission to help, so why shouldn't NPCs be allowed to as well?...
Read more >Pyro Documentation - Read the Docs
a few thousand remote method calls per second on a single proxy ... Configuration Pyro can be configured in a lot of ways....
Read more >c# - How can I find the method that called the current method?
Try this: using System.Diagnostics; // Get call stack StackTrace stackTrace = new StackTrace(); // Get calling method name Console.WriteLine(stackTrace.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Nice. I’ll fix it properly soon then. Nah, it’s okay, I don’t quite remember the reason why that comment was there about getpeername() but apparently there are situations where it fails. It’s nice when it succeeds but I’m okay with not knowing the client connected in certain error scenarios.
That solves it! Thanks 😃
Of course, if you would like to always pass the client socket to the error handler, there may be a way to save it when the message is received. I haven’t looked into the code to see how difficult this would be…