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

Getting error message when running in lambda: message: "Too many open files" #2353

Closed
ion-elgreco opened this issue Mar 28, 2024 Discussed in #2352 · 2 comments · Fixed by #2458
Closed

Getting error message when running in lambda: message: "Too many open files" #2353

ion-elgreco opened this issue Mar 28, 2024 Discussed in #2352 · 2 comments · Fixed by #2458
Labels
bug Something isn't working

Comments

@ion-elgreco
Copy link
Collaborator

Discussed in #2352

Originally posted by rob3000 March 28, 2024
Hi' i'm currently running the deltra-rs rust library in lambda to do a merge query into delta lake. However i noticed i'm getting the following error:

Error: hyper::Error(Connect, ConnectError("tcp open error", Os { code: 24, kind: Uncategorized, message: "Too many open files" }))

It looks like its coming from the DynamoDBLock;

{
    "timestamp": "Mar 28 09:06:04.847",
    "level": "ERROR",
    "fields": {
        "message": "dynamodb client failed to write log entry: GenericDynamoDb { source: HttpDispatch(HttpDispatchError { message: \"Error during dispatch: error trying to connect: dns error: Too many open files (os error 24)\" }) }"
    },
    "target": "deltalake_aws::logstore"
}

I suspect the logstore is trying to create new connections when running through a batch for records to save to deltalake, I'm still quite new to rust, but when i normally talk to dynamoDB i create a a reference outside of the handler and pass the reference through, do i need to look at doing the same with the logstore? And if so how?

@ion-elgreco ion-elgreco added the bug Something isn't working label Mar 28, 2024
@cmackenzie1
Copy link
Contributor

There probably isn't much delta-rs can do here. The Too many open files error is an operating system error. Most operating systems set a limit as to how many open file descriptors one can have opened at once - and each network connection also counts as an open file descriptor.

On macOS and Debian this can be adjusted using ulimit command or by editing /etc/sysctl.conf.

macOS

# see your current limit
ulimit -n

# change the limit
ulimit -n 30000

@ion-elgreco
Copy link
Collaborator Author

@rob3000 fyi

@ion-elgreco ion-elgreco closed this as not planned Won't fix, can't repro, duplicate, stale Apr 11, 2024
rtyler added a commit that referenced this issue May 1, 2024
…jectStoreFactory (#2458)

# Description
This PR adds a configuration to control concurrent access to the
underlying object store. It also includes a visibility change to the
S3LogStoreFactory to align it with all other provider implementations.

# Related Issue(s)
- closes #2457 
- resolves #2353

# Documentation

https://docs.rs/object_store/latest/object_store/limit/struct.LimitStore.html

---------

Co-authored-by: Michele Vigilante <[email protected]>
Co-authored-by: R. Tyler Croy <[email protected]>
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
2 participants