Comments (4)
I think the get()
at the end of create()
is getting tripped up by being inside the AWS fabric and firing before the earlier COLL_CREATE_AN
has a chance to 'settle'.
We can work around this scenario by catching the rare, but real, CollectionDoesNotExist
exception and performing a small number of retries, perhaps with backoff.
Then, the lambda would not proceed until it got the 'go-ahead' that the Collection of interest does already exist in the iRODS catalog.
Something like...
try:
session.collections.create(irods_collection_name, recurse=True)
except CollectionDoesNotExist as e:
print('caught CollectionDoesNotExist, retrying...')
retries = 4
delay_in_seconds = 1.0
backoff_multiplier = 1.2
for i in range(retries):
retry_number = i+1
if retry_number == 1:
sleep_time = delay_in_seconds
else:
sleep_time = sleep_time * backoff_multiplier
print('retry [{}] ... sleeping for [{}]'.format(retry_number, sleep_time))
time.sleep(sleep_time)
try:
collection_created = session.collections.get(irods_collection_name)
break
except CollectionDoesNotExist:
pass
if not collection_created:
print('session.collections.create retried and still failed...')
raise e
except Exception as e:
print(e)
will create a PR for more easy commenting/review.
from irods_client_aws_lambda_s3.
I think the
get()
at the end ofcreate()
is getting tripped up by being inside the AWS fabric and firing before the earlierCOLL_CREATE_AN
has a chance to 'settle'.
But, wouldn't that make it impossible to trust python code in AWS Lambda? The API request for the create op is supposed to be complete by the time the response is captured.
from irods_client_aws_lambda_s3.
Agreed. And yet… here we are seeing failures for the get().
from irods_client_aws_lambda_s3.
and remember, there is a network call to iRODS in there... serviced by... who knows what fabric in the middle...
in fact, two network calls - the mkdir API call, and then the query API to 'see' the newly created collection.
from irods_client_aws_lambda_s3.
Related Issues (7)
- syntax error around ssl detection, when no ssl parameters configured
- ssl cert string fails when >4k in length
- add support for S3->SNS->SQS->Lambda->iRODS
- handle SQS batch size greater than 1 HOT 4
- delete events sometimes labeled ObjectRemoved:DeleteMarkerCreated
- large create events labeled ObjectCreated:CompleteMultipartUpload
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from irods_client_aws_lambda_s3.