File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ def __payload_entrypoint(output_path: str) -> None:
1212
1313 logging .warning ("XXX: dump_heap: writing report to %r" , output_path )
1414 logging .warning ("XXX: dump_heap: collecting gc" )
15- gc .collect ()
15+ gc .collect (0 )
1616 gc .collect (1 )
1717 gc .collect (2 )
1818 seen : set [int ] = set ()
@@ -213,7 +213,15 @@ def _get_payload(obj: Any) -> bytes | None:
213213 payload = b"," .join (payload_entries )
214214 del payload_entries
215215 elif isinstance (obj , asyncio .Task ):
216+ max_payload_size = 4096
216217 payload_str = obj .get_name ()
218+ # The important bits in the stack frames are always towards at
219+ # the bottom. So we revert it for simplicity.
220+ source_traceback = obj ._source_traceback # type: ignore[attr-defined]
221+ if source_traceback is not None :
222+ payload_str += "\n " + "\n " .join (
223+ repr (frame ) for frame in source_traceback [::- 1 ]
224+ )
217225 elif isinstance (obj , asyncio .events .Handle ):
218226 max_payload_size = 4096
219227 # The important bits in the stack frames are always towards at
You can’t perform that action at this time.
0 commit comments