Excited for the new release, but seeing some hangs

20 views
Skip to first unread message

Scott Persinger

unread,
Feb 8, 2025, 8:13:13 AMFeb 8
to thespian.py
Hi Kevin -

I am excited to get onto the new 4.0 release. Generally its working well. This morning however I seemed to have gotten into a sate where something is blocking multiprocTCPBase from starting up. FWIW my code at the moment is calling asys.shutdown() whenever it closes, but I'm probably applying more startup/shutdown than would be normal.

If I ctrl-c my process I get this stack trace:

  File "/Users/scottp/src/agentic/src/agentic/actor_agents.py", line 570, in _init_base_actor

    asys.ask(

  File "/Users/scottp/src/agentic/.venv/lib/python3.11/site-packages/thespian/actors.py", line 738, in ask

    return self._systemBase.ask(actorAddr, msg, timeout)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/Users/scottp/src/agentic/.venv/lib/python3.11/site-packages/thespian/system/systemBase.py", line 264, in ask

    response = self._run_transport(remTime.remaining())

               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/Users/scottp/src/agentic/.venv/lib/python3.11/site-packages/thespian/system/systemBase.py", line 139, in _run_transport

    r = self.transport.run(TransmitOnly if txonly else incomingHandler,

        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/Users/scottp/src/agentic/.venv/lib/python3.11/site-packages/thespian/system/transport/wakeupTransportBase.py", line 71, in run

    rval = self._run_subtransport(incomingHandler, max_runtime)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/Users/scottp/src/agentic/.venv/lib/python3.11/site-packages/thespian/system/transport/wakeupTransportBase.py", line 80, in _run_subtransport

    rval = self._runWithExpiry(incomingHandler)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/Users/scottp/src/agentic/.venv/lib/python3.11/site-packages/thespian/system/transport/TCPTransport.py", line 1158, in _runWithExpiry

    events = sel.select(delay)

             ^^^^^^^^^^^^^^^^^

  File "/opt/homebrew/Cellar/pyt...@3.11/3.11.9/Frameworks/Python.framework/Versions/3.11/lib/python3.11/selectors.py", line 566, in select

    kev_list = self._selector.control(None, max_ev, timeout)

               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

So this is after I call:

asys = ActorSystem("multiprocTCPBase")
but the first message I try to send to the system. Any tips for debugging would be greatly appreciated!

--scott 

Kevin Quick

unread,
Feb 8, 2025, 10:56:29 AMFeb 8
to Scott Persinger, thespian.py
Hello Scott,

Thanks for the report.  I'd recommend trying two things: (1) can you try this with the older version of Thespian to see if it is able to start successfully, and (2) can you check to see if there is an `ActorAdmin` process still running somewhere that might have become unresponsive to the shutdown requests; if you find one, kill it manually and then try running with the 4/0 release.

-Kevin

--
You received this message because you are subscribed to the Google Groups "thespian.py" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thespianpy+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/thespianpy/5a61b231-781e-42ae-b559-ce3bfe086e82n%40googlegroups.com.


--
-KQ

Scott Persinger

unread,
Feb 8, 2025, 2:24:44 PMFeb 8
to thespian.py
So no great luck. I can't see any evidence of other processes still running.

This is 4.0. No other python processes running:

(agentic) (base) scottp@MacBook-Air agentic % ps -ef | grep Admin

  501 40502  3256   0  2:09pm ttys001    0:00.00 grep Admin

(agentic) (base) scottp@MacBook-Air agentic % ps -ef | grep python

  501 40512  3256   0  2:09pm ttys001    0:00.00 grep python

(agentic) (base) scottp@MacBook-Air agentic % 

(agentic) (base) scottp@MacBook-Air agentic % agentic repl examples/news_demo.py

Traceback (most recent call last):

  File "/Users/scottp/src/agentic/src/agentic/repl.py", line 82, in load_agent

    spec.loader.exec_module(module)

  File "<frozen importlib._bootstrap_external>", line 940, in exec_module

  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed

  File "/Users/scottp/src/agentic/examples/news_demo.py", line 41, in <module>

    reporter = Agent(

               ^^^^^^

  File "/Users/scottp/src/agentic/src/agentic/actor_agents.py", line 579, in __init__

    self._init_base_actor(instructions)

  File "/Users/scottp/src/agentic/src/agentic/actor_agents.py", line 605, in _init_base_actor

    asys.ask(

  File "/Users/scottp/src/agentic/.venv/lib/python3.11/site-packages/thespian/actors.py", line 738, in ask

    return self._systemBase.ask(actorAddr, msg, timeout)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/Users/scottp/src/agentic/.venv/lib/python3.11/site-packages/thespian/system/systemBase.py", line 273, in ask

    raise ActorSystemFailure('Transmit of ask message to %s failed (%s)'%(

thespian.actors.ActorSystemFailure: Transmit of ask message to ActorAddr-(T|:52998) failed (-BadPacketError)

----------

Then I downgraded to prior version:

(agentic) (base) scottp@MacBook-Air agentic % uv pip install thespian==3.10.7

Resolved 1 package in 108ms

Uninstalled 1 package in 10ms

Installed 1 package in 3ms

 - thespian==4.0.0

 + thespian==3.10.7

(agentic) (base) scottp@MacBook-Air agentic % agentic repl examples/news_demo.py

Traceback (most recent call last):

  File "/Users/scottp/src/agentic/src/agentic/repl.py", line 53, in <module>

    CURRENT_RUNNER: AgentRunner = AgentRunner(Agent(name="", instructions=""))

                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/Users/scottp/src/agentic/src/agentic/actor_agents.py", line 579, in __init__

    self._init_base_actor(instructions)

  File "/Users/scottp/src/agentic/src/agentic/actor_agents.py", line 586, in _init_base_actor

    asys, logger = create_actor_system()

                   ^^^^^^^^^^^^^^^^^^^^^

  File "/Users/scottp/src/agentic/src/agentic/actor_agents.py", line 515, in create_actor_system

    asys = ActorSystem("multiprocTCPBase")

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/Users/scottp/src/agentic/.venv/lib/python3.11/site-packages/thespian/actors.py", line 637, in __init__

    systemBase = self._startupActorSys(

                 ^^^^^^^^^^^^^^^^^^^^^^

  File "/Users/scottp/src/agentic/.venv/lib/python3.11/site-packages/thespian/actors.py", line 678, in _startupActorSys

    systemBase = sbc(self, logDefs=logDefs)

                 ^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/Users/scottp/src/agentic/.venv/lib/python3.11/site-packages/thespian/system/multiprocTCPBase.py", line 28, in __init__

    super(ActorSystemBase, self).__init__(system, logDefs)

  File "/Users/scottp/src/agentic/.venv/lib/python3.11/site-packages/thespian/system/multiprocCommon.py", line 83, in __init__

    super(multiprocessCommon, self).__init__(system, logDefs)

  File "/Users/scottp/src/agentic/.venv/lib/python3.11/site-packages/thespian/system/systemBase.py", line 326, in __init__

    self._startAdmin(self.adminAddr,

  File "/Users/scottp/src/agentic/.venv/lib/python3.11/site-packages/thespian/system/multiprocCommon.py", line 115, in _startAdmin

    raise InvalidActorAddress(adminAddr,

thespian.actors.InvalidActorAddress: ActorAddr-(T|:1900) is not a valid ActorSystem admin

-------------



Scott Persinger

unread,
Feb 8, 2025, 2:40:49 PMFeb 8
to thespian.py
Ok after reboot, and then setting THESPIAN_BASE_IPADDR=127.0.0.1

(agentic) (base) scottp@MacBook-Air agentic % python examples/basic_agent.py 

WARNING:root:Unable to get address info for address 1.0.0.127.in-addr.arpa (2, 2, 17, 0): <class 'socket.gaierror'> [Errno 8] nodename nor servname provided, or not known

WARNING:root:Unable to get address info for address 1.0.0.127.in-addr.arpa (2, 2, 17, 1): <class 'socket.gaierror'> [Errno 8] nodename nor servname provided, or not known

I am a simple agent here to help. I have a single weather function.

press <enter> to quit

> ^D

Exiting REPL.

(agentic) (base) scottp@MacBook-Air agentic % 

(agentic) (base) scottp@MacBook-Air agentic % export THESPIAN_BASE_IPADDR=127.0.0.1

now it works. I've changed my code to not call "shutdown", so hopefully leaving up the Admin will make it happier.
Reply all
Reply to author
Forward
0 new messages