Skip to content

TypeScript: CodeQL seems to hang after 44s and stops after 6h #15852

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Apollon77 opened this issue Mar 8, 2024 · 5 comments
Open

TypeScript: CodeQL seems to hang after 44s and stops after 6h #15852

Apollon77 opened this issue Mar 8, 2024 · 5 comments
Assignees
Labels
JS question Further information is requested

Comments

@Apollon77
Copy link

Description of the issue

CodeQL was generally working great for @project-chip/matter.js, but now with adding much more auto-generated code (and yes getting a bit fancy on TypeScript edges) the processing hangs at after 44s ... and then stops after 6h

See: https://github.com/project-chip/matter.js/actions/runs/8195839329/job/22414867564?pr=715

@Apollon77 Apollon77 added the question Further information is requested label Mar 8, 2024
@mbg mbg self-assigned this Mar 8, 2024
@mbg mbg added the JS label Mar 8, 2024
@mbg
Copy link
Member

mbg commented Mar 8, 2024

Hi @Apollon77 👋

Thanks for reporting this. I can reproduce your problem locally. It seems that both in your workflow and locally, extraction gets stuck on packages/matter.js/src/node/ServerNode.ts and I can confirm that commenting out the contents of that file allows extraction to succeed again. Concretely, the problem seems to be with the following two definitions:

static async create<
        This extends typeof ServerNode<any>,
        T extends ServerNode.RootEndpoint = ServerNode.RootEndpoint,
    >(this: This, type?: T, options?: Node.Options<T>): Promise<ServerNode<T>>;

static async create<
        This extends typeof ServerNode<any>,
        T extends ServerNode.RootEndpoint = ServerNode.RootEndpoint,
    >(this: This, config: Partial<Node.Configuration<T>>): Promise<ServerNode<T>>;

If either one of these is commented out, then we can also analyse the file successfully. I will pass this on to our JavaScript team. In the meantime, the above might allow you to make some temporary adjustments to your code to allow CodeQL to successfully analyse your project.

You could also use a custom CodeQL configuration file to filter out the path of this file.

@Apollon77
Copy link
Author

Thank you for reacting that fast, thats awesome. We will do the temporary exclusion I think

@Apollon77
Copy link
Author

PS: seems that /home/runner/work/matter.js/matter.js/packages/matter.js/test/behavior/definitions/descriptor/DescriptorServerTest.ts also has comparable issue because it now hangs there when I exclude the above file. I have now excluded all test files as well (which makes sense anyway), but maybe something your JS guys want to look into for the reason

@sidshank sidshank changed the title General issue: CodeQL seems to hang after 44s and stops after 6h TypeScript: CodeQL seems to hang after 44s and stops after 6h Apr 1, 2024
@Apollon77
Copy link
Author

Apollon77 commented Sep 17, 2024

@mbg is there any news on this issue? We restructured our project and now interestingly we are faced with several more places where CodeQL just hangs :-( (basically likely still that one class .. but now also many places where the class is used)

https://github.com/project-chip/matter.js/pull/1189/files#diff-12783128521e452af0cfac94b99b8d250413c516ec71fe6d97dbea666ff7ba27R40

@mbg
Copy link
Member

mbg commented Sep 17, 2024

Hi @Apollon77, sorry about that. I have let the JS team know that this is still an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JS question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants