actor-framework icon indicating copy to clipboard operation
actor-framework copied to clipboard

Is there any way to print out all alive actor's id?

Open xiewei20082008 opened this issue 5 years ago • 2 comments

Hi,

Occasionally, my program hangs at await_all_actors_done() call during exiting. I want to figure out which actor is remaining in the system. Is there any function to print out all alive actor's id?

I know I can enable CAF debug log or use the profiler, but I don't want to make it complex on customers' environment, so just want to find if there is a quick function then I can add it at the end of the program.

Thanks.

xiewei20082008 avatar Mar 24 '21 11:03 xiewei20082008

No, there's no central data structure that stores handles to all actors in the system. Mainly because that could quite easily become a performance bottleneck.

There are alternatives to a single data structure. For example by leveraging the tree-like structure of spawn relationships (each actor could store weak references to all actors it spawned). I think a feature like this would be very nice to have, but currently there are no plans or proposals for it.

Neverlord avatar Mar 24 '21 12:03 Neverlord

For example by leveraging the tree-like structure of spawn relationships (each actor could store weak references to all actors it spawned)

Sounds great. Thank you for your reply.

xiewei20082008 avatar Mar 25 '21 11:03 xiewei20082008