{"id":1646,"date":"2026-11-01T13:08:11","date_gmt":"2026-11-01T04:08:11","guid":{"rendered":"https:\/\/danlabs.kr\/?p=1646"},"modified":"2026-11-14T01:47:32","modified_gmt":"2026-11-13T16:47:32","slug":"python-asyncio-taskgroup-gather-errors-cancellation","status":"publish","type":"post","link":"https:\/\/danlabs.kr\/?p=1646","title":{"rendered":"Python asyncio TaskGroup\uacfc gather \ube44\uad50 \u2014 \uc608\uc678\uc640 \ucde8\uc18c\uac00 \uc804\ud30c\ub418\ub294 \ubc94\uc704"},"content":{"rendered":"<p>\uc5ec\ub7ec \ube44\ub3d9\uae30 \uc791\uc5c5 \uc911 \ud558\ub098\uc5d0\uc11c \uc624\ub958\uac00 \ub0ac\uc744 \ub54c, \ub098\uba38\uc9c0 \uc791\uc5c5\uc774 \uacc4\uc18d \uc2e4\ud589\ub418\ub294\uc9c0\ub294 \uc791\uc5c5\uc744 \ubb36\ub294 \ubc29\uc2dd\uc5d0 \ub530\ub77c \ub2ec\ub77c\uc838\uc694. Python \uacf5\uc2dd \ubb38\uc11c\ub97c \ubc14\ud0d5\uc73c\ub85c <code>asyncio.gather()<\/code>\uc640 <code>TaskGroup<\/code>\uc758 \uc608\uc678 \ucc98\ub9ac\uc640 \ucde8\uc18c \uc804\ud30c \ubc94\uc704\ub97c \ube44\uad50\ud569\ub2c8\ub2e4.<a href=\"#source-1\">[1]<\/a><\/p>\n<figure><img decoding=\"async\" src=\"https:\/\/danlabs.kr\/wp-content\/uploads\/2026\/11\/dev-20261101-inline1.jpg\" alt=\"\ube44\ub3d9\uae30 \uc791\uc5c5 \uc2e4\ud589\uacfc \uc624\ub958 \uc804\ub2ec, \ub0a8\uc740 \uc791\uc5c5 \ud655\uc778 \ub3c4\uc2dd\" \/><\/figure>\n<h2>gather: \uc608\uc678\ub97c \uc804\ub2ec\ud574\ub3c4 \ub2e4\ub978 \uc791\uc5c5\uc740 \uacc4\uc18d \uc2e4\ud589\ub41c\ub2e4<\/h2>\n<p><code>asyncio.gather()<\/code>\ub294 \uc804\ub2ec\ubc1b\uc740 awaitable\ub4e4\uc744 \ub3d9\uc2dc\uc5d0 \uc2e4\ud589\ud558\uace0 \uc644\ub8cc\ub97c \uae30\ub2e4\ub824\uc694. \uae30\ubcf8 \uc124\uc815\uc778 <code>return_exceptions=False<\/code>\uc5d0\uc11c\ub294 \uccab \uc608\uc678\ub97c <code>gather<\/code>\ub97c \uae30\ub2e4\ub9ac\ub294 \ucabd\uc5d0 \uc989\uc2dc \uc804\ub2ec\ud569\ub2c8\ub2e4. \uc774\ub54c \ub098\uba38\uc9c0 awaitable\uc740 \uc790\ub3d9\uc73c\ub85c \ucde8\uc18c\ub418\uc9c0 \uc54a\uace0 \uacc4\uc18d \uc2e4\ud589\ub3fc\uc694.<a href=\"#source-1\">[1]<\/a><\/p>\n<p>\ub530\ub77c\uc11c \ud638\ucd9c\uc790\uac00 \uc624\ub958\ub97c \ubc1b\uc558\ub2e4\uace0 \ud574\uc11c \ub2e4\ub978 \uc791\uc5c5\uae4c\uc9c0 \uba48\ucd98 \uac83\uc740 \uc544\ub2c8\uc5d0\uc694. \ud55c \uc791\uc5c5\uc774 \uc2e4\ud328\ud574\ub3c4 \ub098\uba38\uc9c0 \uacb0\uacfc\uac00 \ud544\uc694\ud55c\uc9c0, \ubb36\uc74c \uc804\uccb4\ub97c \uc911\ub2e8\ud574\uc57c \ud558\ub294\uc9c0\ub97c \uad6c\ubd84\ud574\uc57c \ud569\ub2c8\ub2e4.<\/p>\n<p><code>return_exceptions=True<\/code>\ub97c \uc9c0\uc815\ud558\uba74 \uc608\uc678\ub3c4 \uacb0\uacfc \ubaa9\ub85d\uc758 \ud56d\ubaa9\uc73c\ub85c \ucde8\uae09\ud574\uc694.<a href=\"#source-1\">[1]<\/a> \uc624\ub958 \uc790\uccb4\ub97c \uc5c6\uc560\uc9c0\ub294 \uc54a\uc73c\uba70, \ud638\ucd9c\uc790\ub294 \ubaa9\ub85d\uc758 \uac01 \ud56d\ubaa9\uc774 \uc131\uacf5 \uac12\uc778\uc9c0 \uc608\uc678\uc778\uc9c0 \uad6c\ubd84\ud574\uc57c \ud569\ub2c8\ub2e4.<\/p>\n<h2>TaskGroup: \uc2e4\ud328\ud558\uba74 \ub0a8\uc740 \uc791\uc5c5\uc744 \ucde8\uc18c\ud558\uace0 \uc885\ub8cc\ub97c \uae30\ub2e4\ub9b0\ub2e4<\/h2>\n<figure><img decoding=\"async\" src=\"https:\/\/danlabs.kr\/wp-content\/uploads\/2026\/11\/dev-20261101-inline2.jpg\" alt=\"\uadf8\ub8f9 \uc791\uc5c5 \ub4f1\ub85d\uacfc \ub300\uae30, \uc2e4\ud328 \uc2dc \ucde8\uc18c \ud750\ub984\" \/><\/figure>\n<p><code>TaskGroup<\/code>\uc740 \ube44\ub3d9\uae30 \ucee8\ud14d\uc2a4\ud2b8 \uad00\ub9ac\uc790 \uc548\uc5d0 \uc791\uc5c5\uc744 \ubaa8\uc73c\uace0, \ucee8\ud14d\uc2a4\ud2b8\ub97c \ubc97\uc5b4\ub0a0 \ub54c \uadf8\ub8f9\uc758 \ubaa8\ub4e0 \uc791\uc5c5\uc744 \uae30\ub2e4\ub824\uc694. Python 3.11\uc5d0 \ucd94\uac00\ub41c API\uc774\ubbc0\ub85c \uc2e4\ud589 \ud658\uacbd\uc758 \ubc84\uc804\uc744 \uba3c\uc800 \ud655\uc778\ud574\uc57c \ud569\ub2c8\ub2e4.<a href=\"#source-1\">[1]<\/a><\/p>\n<p>\uacf5\uc2dd \ubb38\uc11c\ub294 \uc791\uc5c5\uc774\ub098 \uadf8 \ud558\uc704 \uc791\uc5c5\uc774 \uc608\uc678\ub97c \ub0b4\uba74 <code>TaskGroup<\/code>\uc740 \ub0a8\uc740 \uc791\uc5c5\uc744 \ucde8\uc18c\ud558\uc9c0\ub9cc <code>gather<\/code>\ub294 \uadf8\ub807\uc9c0 \uc54a\ub2e4\uace0 \uc124\uba85\ud574\uc694.<a href=\"#source-1\">[1]<\/a> \ud568\uaed8 \uc131\uacf5\ud558\uac70\ub098 \ud568\uaed8 \uc2e4\ud328\ud574\uc57c \uc758\ubbf8\uac00 \uc788\ub294 \uc791\uc5c5\uc744 \ubb36\uc744 \ub54c \uc911\uc694\ud55c \ucc28\uc774\uc785\ub2c8\ub2e4. \ub2e4\ub9cc \ucde8\uc18c\uac00 \uc774\ubbf8 \uc2e4\ud589\ub41c \uc678\ubd80 \uc791\uc5c5\uc744 \ub418\ub3cc\ub9ac\uc9c0\ub294 \uc54a\uc544\uc694. \uc6d0\uaca9 \uc11c\ube44\uc2a4\uc5d0 \ubc18\uc601\ub41c \ubcc0\uacbd\uc774 \ucde8\uc18c \uc54c\ub9bc\ub9cc\uc73c\ub85c \ubcf5\uad6c\ub41c\ub2e4\uace0 \uac00\uc815\ud574\uc11c\ub294 \uc548 \ub429\ub2c8\ub2e4.<\/p>\n<p>\uc791\uc5c5\uc740 <code>tg.create_task()<\/code>\ub85c \ucd94\uac00\ud574\uc694. \ucee8\ud14d\uc2a4\ud2b8\ub97c \ubc97\uc5b4\ub09c \ub4a4 \uacb0\uacfc\ub97c \uc0ac\uc6a9\ud558\ub824\uba74 \ubc18\ud658\ub41c \uc791\uc5c5 \uac1d\uccb4\ub97c \ubcf4\uad00\ud558\uace0, \uc815\uc0c1 \uc885\ub8cc \ud6c4 \uacb0\uacfc\ub97c \ud655\uc778\ud558\uba74 \ub429\ub2c8\ub2e4. \uc624\ub958\uac00 \uc608\uc0c1\ub418\ub294 \ud638\ucd9c\uc740 \uc608\uc678 \ucc98\ub9ac\uc640 \uc815\ub9ac \uacbd\ub85c\ub3c4 \ud568\uaed8 \uc124\uacc4\ud574\uc57c \ud574\uc694.<a href=\"#source-1\">[1]<\/a><\/p>\n<h2>gather \uc790\uccb4\uc758 \ucde8\uc18c\uc640 \uac1c\ubcc4 \uc791\uc5c5\uc758 \uc608\uc678\ub294 \uad6c\ubd84\ud574\uc57c \ud55c\ub2e4<\/h2>\n<p>\ud55c \uc791\uc5c5\uc5d0\uc11c \uc608\uc678\uac00 \ubc1c\uc0dd\ud558\ub294 \uac83\uacfc <code>gather<\/code> \uc790\uccb4\uac00 \ucde8\uc18c\ub418\ub294 \uac83\uc740 \ub2e4\ub978 \uc0c1\ud669\uc774\uc5d0\uc694. \ubb38\uc11c\uc5d0 \ub530\ub974\uba74 <code>gather<\/code> \uc790\uccb4\uac00 \ucde8\uc18c\ub418\uba74 \uc804\ub2ec\ubc1b\uc740 awaitable \uc911 \uc544\uc9c1 \uc644\ub8cc\ub418\uc9c0 \uc54a\uc740 \ub300\uc0c1\ub3c4 \ucde8\uc18c\ub429\ub2c8\ub2e4.<a href=\"#source-1\">[1]<\/a> \uc55e\uc11c \uc124\uba85\ud55c \u2018\ub2e4\ub978 \uc791\uc5c5\uc744 \ucde8\uc18c\ud558\uc9c0 \uc54a\ub294\ub2e4\u2019\ub294 \uae30\ubcf8 \ub3d9\uc791\uc744 \ubaa8\ub4e0 \ucde8\uc18c \uc0c1\ud669\uc5d0 \uc801\uc6a9\ud574\uc11c\ub294 \uc548 \ub3fc\uc694.<\/p>\n<p><code>TaskGroup<\/code>\uacfc <code>asyncio.timeout()<\/code>\uc740 \ub0b4\ubd80\uc801\uc73c\ub85c \ucde8\uc18c\ub97c \uc0ac\uc6a9\ud574\uc694. \uacf5\uc2dd \ubb38\uc11c\ub294 \ucf54\ub8e8\ud2f4\uc774 <code>CancelledError<\/code>\ub97c \uc0bc\ud0a4\uba74 \uc774\ub7f0 \uad6c\uc870\ud654\ub41c \ub3d9\uc2dc\uc131 \uad6c\uc131 \uc694\uc18c\uac00 \uc798\ubabb \ub3d9\uc791\ud560 \uc218 \uc788\ub2e4\uace0 \uacbd\uace0\ud569\ub2c8\ub2e4.<a href=\"#source-1\">[1]<\/a> \uc815\ub9ac \uc791\uc5c5\uc744 \uc704\ud574 \uc608\uc678\ub97c \uc7a1\ub354\ub77c\ub3c4 \uc774\ud6c4 \uc5b4\ub5a4 \uacbd\ub85c\uc5d0\uc11c \ub2e4\uc2dc \uc804\ub2ec\ud560\uc9c0 \ud655\uc778\ud574\uc57c \ud574\uc694. \ucde8\uc18c\ub97c \uc77c\ubc18\uc801\uc778 \uc131\uacf5\uc73c\ub85c \ucc98\ub9ac\ud558\uba74 \uc885\ub8cc \uc808\ucc28\ub97c \ud30c\uc545\ud558\uae30 \uc5b4\ub824\uc6cc\uc9d1\ub2c8\ub2e4.<\/p>\n<h2>\uc120\ud0dd\uacfc \uac80\uc99d\uc5d0 \ud544\uc694\ud55c \uc138 \uac00\uc9c0 \uae30\uc900<\/h2>\n<figure><img decoding=\"async\" src=\"https:\/\/danlabs.kr\/wp-content\/uploads\/2026\/11\/dev-20261101-inline3.jpg\" alt=\"\uc608\uc678 \ucc98\ub9ac\uc640 \ucde8\uc18c \uacbd\ub85c, \ubc84\uc804 \ud655\uc778 \uc810\uac80 \ud56d\ubaa9\" \/><\/figure>\n<ul>\n<li>\ud55c \uc791\uc5c5\uc774 \uc2e4\ud328\ud574\ub3c4 \ub3c5\ub9bd\ub41c \uacb0\uacfc\ub97c \ubaa8\ub450 \ud655\uc778\ud574\uc57c \ud55c\ub2e4\uba74 <code>gather<\/code>\uc758 \uc608\uc678 \uc804\ub2ec \uc124\uc815\uc744 \uac80\ud1a0\ud558\uc138\uc694.<\/li>\n<li>\ubb36\uc74c \uc2e4\ud328 \uc2dc \ub0a8\uc740 \uc791\uc5c5\uc744 \ucde8\uc18c\ud574\uc57c \ud55c\ub2e4\uba74 <code>TaskGroup<\/code>\uc758 \ub3d9\uc791\uacfc \uc2e4\ud589 \ud658\uacbd\uc758 Python \ubc84\uc804\uc744 \ud655\uc778\ud558\uc138\uc694. \uc678\ubd80 \uc2dc\uc2a4\ud15c\uc5d0 \uc774\ubbf8 \ubc18\uc601\ub41c \ubcc0\uacbd\uc758 \ubcf5\uad6c\ub294 \ubcc4\ub3c4\ub85c \uc810\uac80\ud574\uc57c \ud569\ub2c8\ub2e4.<\/li>\n<li>\ucf54\ub8e8\ud2f4\uc758 \uc815\ub9ac \ucf54\ub4dc\uac00 \ucde8\uc18c\ub97c \uc5b4\ub5bb\uac8c \ucc98\ub9ac\ud558\ub294\uc9c0 \ud14c\uc2a4\ud2b8\ud558\uc138\uc694.<\/li>\n<\/ul>\n<p>\uc678\ubd80 \ubcc0\uacbd\uc758 \ubc18\uc601\uacfc \ub418\ub3cc\ub9ac\uae30\ub97c \uad6c\ubd84\ud558\ub294 Python \uc2e4\ubb34 \uc8fc\uc81c\ub85c\ub294 <a href=\"https:\/\/danlabs.kr\/?p=1609\">sqlite3 \ud2b8\ub79c\uc7ad\uc158\uc5d0\uc11c commit\uacfc rollback \uad6c\ubd84\ud558\uae30<\/a>\ub3c4 \ucc38\uace0\ud560 \uc218 \uc788\uc5b4\uc694.<\/p>\n<p><strong>\ucd9c\ucc98<\/strong>: Python \uacf5\uc2dd \ubb38\uc11c, \uc870\ud68c 2026-11-01<\/p>\n<ul>\n<li id=\"source-1\"><a href=\"https:\/\/docs.python.org\/3\/library\/asyncio-task.html\" target=\"_blank\" rel=\"noopener noreferrer\">Python Software Foundation \u2014 Coroutines and tasks<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>gather\ub294 \uae30\ubcf8 \uc124\uc815\uc5d0\uc11c \uccab \uc608\uc678\ub97c \ud638\ucd9c\uc790\uc5d0\uac8c \uc804\ub2ec\ud574\ub3c4 \ub2e4\ub978 \uc791\uc5c5\uc744 \uc790\ub3d9\uc73c\ub85c \ucde8\uc18c\ud558\uc9c0 \uc54a\uc544\uc694. TaskGroup\uc740 \uc791\uc5c5 \uc2e4\ud328 \uc2dc \ub0a8\uc740 \uc791\uc5c5\uc744 \ucde8\uc18c\ud558\uace0 \uc885\ub8cc\ub97c \uae30\ub2e4\ub824\uc694. gather \uc790\uccb4\uac00 \ucde8\uc18c\ub41c \uacbd\uc6b0\ub294 \uac1c\ubcc4 \uc791\uc5c5\uc758 \uc2e4\ud328\uc640 \uad6c\ubd84\ud574\uc57c \ud574\uc694.<\/p>\n","protected":false},"author":1,"featured_media":2447,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[],"class_list":["post-1646","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dev"],"featured_image_urls":{"full":["https:\/\/danlabs.kr\/wp-content\/uploads\/2026\/11\/python-asyncio-taskgroup-gather-errors-1646-concept.webp",1536,1024,false],"thumbnail":["https:\/\/danlabs.kr\/wp-content\/uploads\/2026\/11\/python-asyncio-taskgroup-gather-errors-1646-concept-150x150.webp",150,150,true],"medium":["https:\/\/danlabs.kr\/wp-content\/uploads\/2026\/11\/python-asyncio-taskgroup-gather-errors-1646-concept-300x200.webp",300,200,true],"medium_large":["https:\/\/danlabs.kr\/wp-content\/uploads\/2026\/11\/python-asyncio-taskgroup-gather-errors-1646-concept-768x512.webp",640,427,true],"large":["https:\/\/danlabs.kr\/wp-content\/uploads\/2026\/11\/python-asyncio-taskgroup-gather-errors-1646-concept-1024x683.webp",640,427,true],"1536x1536":["https:\/\/danlabs.kr\/wp-content\/uploads\/2026\/11\/python-asyncio-taskgroup-gather-errors-1646-concept.webp",1536,1024,false],"2048x2048":["https:\/\/danlabs.kr\/wp-content\/uploads\/2026\/11\/python-asyncio-taskgroup-gather-errors-1646-concept.webp",1536,1024,false],"morenews-large":["https:\/\/danlabs.kr\/wp-content\/uploads\/2026\/11\/python-asyncio-taskgroup-gather-errors-1646-concept.webp",825,550,false],"morenews-medium":["https:\/\/danlabs.kr\/wp-content\/uploads\/2026\/11\/python-asyncio-taskgroup-gather-errors-1646-concept.webp",590,393,false],"danlabs-list-small":["https:\/\/danlabs.kr\/wp-content\/uploads\/2026\/11\/python-asyncio-taskgroup-gather-errors-1646-concept-366x190.webp",366,190,true],"danlabs-list-retina":["https:\/\/danlabs.kr\/wp-content\/uploads\/2026\/11\/python-asyncio-taskgroup-gather-errors-1646-concept-1464x760.webp",1464,760,true]},"author_info":{"display_name":"DanLABs","author_link":"https:\/\/danlabs.kr\/author\/hello-danlabs-kr"},"category_info":"<a href=\"https:\/\/danlabs.kr\/?cat=19\" rel=\"category\">\uac1c\ubc1c<\/a>","tag_info":"\uac1c\ubc1c","comment_count":"0","_links":{"self":[{"href":"https:\/\/danlabs.kr\/index.php?rest_route=\/wp\/v2\/posts\/1646","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/danlabs.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/danlabs.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/danlabs.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/danlabs.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1646"}],"version-history":[{"count":3,"href":"https:\/\/danlabs.kr\/index.php?rest_route=\/wp\/v2\/posts\/1646\/revisions"}],"predecessor-version":[{"id":2507,"href":"https:\/\/danlabs.kr\/index.php?rest_route=\/wp\/v2\/posts\/1646\/revisions\/2507"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/danlabs.kr\/index.php?rest_route=\/wp\/v2\/media\/2447"}],"wp:attachment":[{"href":"https:\/\/danlabs.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1646"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/danlabs.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1646"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/danlabs.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1646"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}