alibaba / alibaba/hiactor

Hiactor codegen lack diagnostic info

Open
#44 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
119
Forks
20
PR merge metrics
No merged PRs in 30d

Description

The Hiactor code generator fails to output essential debug and diagnostic information when code generation from actor.h encounters issues.

```txt
Traceback (most recent call last):
File "/usr/local/bin/hiactor_codegen/actor_codegen.py", line 188, in
process_actors(act_process_args)
File "/usr/local/bin/hiactor_codegen/actor_codegen.py", line 72, in process_actors
p.map(process_one_actor, process_args)
File "/usr/lib/python3.10/multiprocessing/pool.py", line 367, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "/usr/lib/python3.10/multiprocessing/pool.py", line 774, in get
raise self._value
File "/usr/lib/python3.10/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/usr/lib/python3.10/multiprocessing/pool.py", line 48, in mapstar
return list(map(*args))
File "/usr/local/bin/hiactor_codegen/actor_codegen.py", line 86, in process_one_actor
traverse_actor_types(unit.cursor, arg.filepath, act_list, ns_list)
File "/usr/local/bin/hiactor_codegen/traverse.py", line 171, in traverse_actor_types
traverse_actor_types(child, filepath, act_list, ns_list)
File "/usr/local/bin/hiactor_codegen/traverse.py", line 171, in traverse_actor_types
traverse_actor_types(child, filepath, act_list, ns_list)
File "/usr/local/bin/hiactor_codegen/traverse.py", line 164, in traverse_actor_types
methods, base_info = traverse_actor_components(node)
File "/usr/local/bin/hiactor_codegen/traverse.py", line 144, in traverse_actor_components
methods.append(check_and_parse_actor_method(node.spelling, child))
File "/usr/local/bin/hiactor_codegen/traverse.py", line 107, in check_and_parse_actor_method
raise RuntimeError("The return type {} of method {} in actor class {} should be void or seastar::future!"
RuntimeError: The return type int of method do_codegen in actor class codegen_actor should be void or seastar::future!
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the code-generation failure from actor.h, then read hiactor_codegen/actor_codegen.py and hiactor_codegen/traverse.py, especially check_and_parse_actor_method. Trace how the RuntimeError is surfaced during multiprocessing and identify what diagnostic context is currently lost. Done means code-generation failures provide the essential debug and diagnostic information described by the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.