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

Lambda does not exit on errors, keeps running until timeout #5009

Open
OperationalFallacy opened this issue May 21, 2024 · 4 comments
Open
Labels
bug Something isn't working

Comments

@OperationalFallacy
Copy link

Describe the bug

I haven't tested it super thoroughly, but I saw Lambda runs till max timeout even thought it couldn't process anything. One example was sending gz files which I realized not supported

Steps to reproduce (if applicable)
Steps to reproduce the behavior:

  1. deploy indexer lambda
  2. send compressed file, test.json.gz

Expected behavior

It should exit immediately and not run until timeout

Configuration:

export class RustFunction extends Function {
  constructor(scope: Construct, id: string, props?: Partial<FunctionProps>) {
    const lambdaAssetPath = path.join(
      __dirname,
      "../../quickwit/quickwit",
      "quickwit-lambda/deploy",
      id
    );
    console.log("lambdaAssetPath", lambdaAssetPath);
    super(scope, id+'_f', {
      ...props,
      code: Code.fromAsset(lambdaAssetPath),
      handler: id, // use id to specify either "indexer" or "searcher"
      runtime: Runtime.PROVIDED_AL2,
      architecture: Architecture.ARM_64,
      logRetention: RetentionDays.ONE_DAY,
      tracing: Tracing.DISABLED,
    });
  }
}

Binaries compiled with this command (I didn't use cross it was too slow on Mac)

LIBZ_SYS_STATIC=1 TARGET_CC=aarch64-linux-musl-gcc RUSTFLAGS="-C linker=aarch64-linux-musl-gcc -C link-arg=-static -C opt-level=z -C lto" cargo build --release --target aarch64-unknown-linux-musl

  1. Output of quickwit --version

checked out v0.8.1

  1. The index_config.yaml

version: 0.7

index_id: test-index

doc_mapping:
  field_mappings:
    - name: website
      type: text
    - name: name
      type: text
    - name: founded
      type: i64
      indexed: true
      fast: true
    - name: size
      type: text
    - name: locality
      type: text
    - name: region
      type: text
      fast: true
    - name: country
      type: text
      fast: true
    - name: industry
      type: text
      fast: true
    - name: linkedin_url
      type: text

search_settings:
  default_search_fields: [name]

indexing_settings:
  split_num_docs_target: 2000000

@OperationalFallacy OperationalFallacy added the bug Something isn't working label May 21, 2024
@rdettai
Copy link
Contributor

rdettai commented May 21, 2024

Hi @OperationalFallacy, thanks for reporting this.

It would be a useful improvement indeed, even though it is far from trivial to identify all un-recoverable errors and bubble them up to stop the lambda.

One example was sending gz files which I realized not supported

gz files are supported, if you run Quickwit Lambda with these packages it should work just fine.

In general, we don't guaranty that main or the Quickwit release tags (e.g 0.8.1) builds to a functioning AWS Lambda. The release cycle of Quickwit Lambda is still independent at this stage. You should use the Lambda release tags instead (aws-lambda-beta-xx).

@OperationalFallacy
Copy link
Author

Agree, won't be easy.
I saw it runs server-side software. Pretty remarkable you made it work in Lambda, and so well.

Is there an option to make all errors unrecoverable?
If users prefer Lambda can use own retry mechanism.
I recognize, though - this is probably not how quickwit servers designed :)

Thanks for pointing to the tags, I'll try it!

@rdettai
Copy link
Contributor

rdettai commented May 28, 2024

Is there an option to make all errors unrecoverable?

There is currently a retry mechanism at the indexing pipeline level that could be disabled. That wouldn't be a silver bullet solution but might already avoid hanging in many failure cases.

@OperationalFallacy
Copy link
Author

That should help. Is there a configuration option to disable it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants