Skip to content

build timeout does not propagate as timeout #13

Description

@PLukas2018

We have timeout when building kernel

timeout: options?.timeout,

the timeout ends the command in the container but it is not propagated as error/timeout to nodejs and it is taken as success.

Reproducer:

/* reproducer.js */
import { execFile, execSync } from "child_process";                             
import { join } from "path";                                                    
import { promisify } from "util";                                               
                                                                                
const execFilePromisify = promisify(execFile);                                  
                                                                                
try {                                                                           
  const { stdout, stderr } = await execFilePromisify(                           
    "podman",                                                                   
    ["exec", "-ti", "<container-id>", "bash", "-c", "sleep 50000; echo a"],       
    {                                                                           
      encoding: "utf-8",                                                        
      timeout: 1000,                                                            
    },                                                                          
  );                                                                            
  console.error("ok");                                                          
  console.error(stdout, stderr);                                                
} catch (e) {                                                                   
  console.error("error");                                                       
  console.error(e);                                                             
}
$ node reproducer.js
ok

I think this could be solved by using directly timeout command which should take care that we get error to node.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions