GithubHelp home page GithubHelp logo

Comments (4)

trel avatar trel commented on September 21, 2024

From https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html:

A large batch size can improve efficiency for workloads that are very fast or have a lot of overhead. However, if your function returns an error, all items in the batch return to the queue.

This suggests the lambda:

  1. must be able to 'unwind' any successful registrations in the face of an error within the batch
    OR
  2. not 'unwind', return the real error and return the items to the queue, and then not return an error the next time if earlier registrations have already made it into the catalog (aka 'CATALOG_ALREADY_HAS_ITEM_BY_THAT_NAME')

If option 2, what prevents whatever issue that caused the failure the first time from also failing in the next batch? Or maybe that's fine... all the well-behaved items will have already been registered?

from irods_client_aws_lambda_s3.

trel avatar trel commented on September 21, 2024

Alternatively, we embrace the lack of support for batch sizes greater than 1...


If the length of 'Records' is greater than 1:

  • log a clear message for the administrator about batch size
  • return an error (which will return all events to the queue for later)

This will prevent the current state of:

  • partial success (with the rest of the records being ignored)
  • confusion for the administrator

from irods_client_aws_lambda_s3.

trel avatar trel commented on September 21, 2024

Being able to support arbitrary batch sizes will require the iRODS server to handle multiple data object operations of 'register' and 'unregister', atomically (new API endpoint). And the python-irodsclient will need to learn the new server API call...

from irods_client_aws_lambda_s3.

trel avatar trel commented on September 21, 2024

Since 4.3.0 - the iRODS server now accepts atomic_apply_database_operations...
but we haven't tried/tested it with the lambda yet.

However...

A new wrinkle... AWS now supports batchItemFailures...

Since Nov 2021...
https://aws.amazon.com/about-aws/whats-new/2021/11/aws-lambda-partial-batch-response-sqs-event-source/

The official docs...
https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#services-sqs-batchfailurereporting

And a writeup from the community...
https://betterprogramming.pub/sqs-batch-processing-with-reporting-batch-item-failures-6c405c852401

from irods_client_aws_lambda_s3.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.