Bug 228866 - [ews] Ensure file handle is not leaked in loadConfig.py
Summary: [ews] Ensure file handle is not leaked in loadConfig.py
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Aakash Jain
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-08-06 09:42 PDT by Aakash Jain
Modified: 2021-08-07 13:56 PDT (History)
6 users (show)

See Also:


Attachments
Patch (1.94 KB, patch)
2021-08-06 09:43 PDT, Aakash Jain
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Aakash Jain 2021-08-06 09:42:05 PDT
Ensure file handle is not leaked in loadConfig.py, for ews and build.webkit.org

Similar to https://commits.webkit.org/237299@main
Comment 1 Aakash Jain 2021-08-06 09:43:15 PDT
Created attachment 435074 [details]
Patch
Comment 2 Alexey Proskuryakov 2021-08-06 10:32:27 PDT
Comment on attachment 435074 [details]
Patch

The change is clearly an improvement, but I'm curious if we actually observed the problem in practice (i.e. observed that garbage collection didn't do it quickly).
Comment 3 Aakash Jain 2021-08-07 13:24:48 PDT
(In reply to Alexey Proskuryakov from comment #2)
> Comment on attachment 435074 [details]
> I'm curious if we actually observed the problem in practice.
Not really. The motivation for this change was that when the unit-test fail for something, they also print following error about this closed file. This sometimes makes the unit-test failure message ugly and confusing (e.g. https://ews-build.webkit.org/#/builders/20/builds/53092/steps/12/logs/stdio).

Stderr:
Exception ignored in: <_io.FileIO name='Tools/CISupport/ews-build/config.json' mode='rb' closefd=True>
ResourceWarning: unclosed file <_io.TextIOWrapper name='Tools/CISupport/ews-build/config.json' mode='r' encoding='UTF-8'>
Comment 4 EWS 2021-08-07 13:55:31 PDT
Committed r280759 (240344@main): <https://commits.webkit.org/240344@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 435074 [details].
Comment 5 Radar WebKit Bug Importer 2021-08-07 13:56:16 PDT
<rdar://problem/81657719>