Skip to content
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

Attempt to detect faulty compiler/language population #6610

Merged
merged 8 commits into from
Jul 7, 2024

Conversation

partouf
Copy link
Member

@partouf partouf commented Jun 16, 2024

Would maybe fix super rare issue which causes 404's when compiling and when CE failed to detect the error at startup.

@partouf
Copy link
Member Author

partouf commented Jun 16, 2024

Goal is to prevent consistent 404's like this:

amazon warn: 109.251.212.0 "POST /api/compiler/g141/compile" 404 
amazon  warn: Unable to find compiler with lang c   for JSON request {"allowStoreCodeDebug":true,"bypassCache":0,"compiler":"g141","files":[],"lang":"c  ","options":{"compilerOptions":{"overrides":[],"produceCfg":false,"produceDevice":false,"produceGccDump":{},"produceIr":null,"produceOptInfo":false,"produceOptPipeline":null,"producePp":null},"executeParameters":{"args":"","stdin":""},"filters":{"binary":false,"binaryObject":false,"commentOnly":true,"debugCalls":false,"demangle":true,"directives":true,"execute":false,"intel":true,"labels":true,"libraryCode":true,"trim":false},"libraries":[],"tools":[],"userArguments":""},"source":"<removed>"} 

app.ts Fixed Show fixed Hide fixed
app.ts Fixed Show fixed Hide fixed
lib/handlers/health-check.ts Outdated Show resolved Hide resolved
@partouf
Copy link
Member Author

partouf commented Jun 21, 2024

Can be simulated by setting this.compilersById = {}; in CompileHandler.setCompilers()

With health-check change:

warn: Unable to find compiler with lang c   for JSON request {"allowStoreCodeDebug":true,"bypassCache":1,"compiler":"g132","files":[],"lang":"c  ","options":{"compilerOptions":{"executorRequest":true,"overrides":[],"skipAsm":true},"executeParameters":{"args":"","runtimeTools":[],"stdin":""},"filters":{"execute":true},"libraries":[],"tools":[],"userArguments":""},"source":"<removed>"}
warn: POST /api/compiler/g132/compile 404 23.109 ms - 9
error: *** HEALTH CHECK FAILURE: no languages/compilers detected

Of course if this.compilersById is set partially this will not fix it. And I wouldn't know how this can happen in reality.. but .. it's something

app.ts Dismissed Show dismissed Hide dismissed
test/handlers/health-check-tests.ts Dismissed Show dismissed Hide dismissed
test/handlers/health-check-tests.ts Dismissed Show dismissed Hide dismissed
test/handlers/health-check-tests.ts Dismissed Show dismissed Hide dismissed
test/handlers/health-check-tests.ts Dismissed Show dismissed Hide dismissed
@@ -538,10 538,16 @@ async function main() {
if (opts.prediscovered) {
const prediscoveredCompilersJson = await fs.readFile(opts.prediscovered, 'utf8');
initialCompilers = JSON.parse(prediscoveredCompilersJson);
await compilerFinder.loadPrediscovered(initialCompilers);
const prediscResult = await compilerFinder.loadPrediscovered(initialCompilers);
if (prediscResult.length === 0) {
Copy link
Member Author

@partouf partouf Jun 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

empty initialCompilers will not cause compilation errors if you call the /compile endpoint, but it does cause en empty UI without languages and compilers which is not very user friendly

@partouf partouf marked this pull request as ready for review June 21, 2024 03:18
@partouf partouf merged commit 75acc5b into main Jul 7, 2024
17 checks passed
@partouf partouf deleted the no-compilers-error-check branch July 7, 2024 11:09
@partouf
Copy link
Member Author

partouf commented Jul 7, 2024

let's give this a shot

@partouf
Copy link
Member Author

partouf commented Jul 7, 2024

This is now live

This is a workaround/fix for #6689

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant