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

potential block when using proxy protocol #208

Closed
robklg opened this issue May 3, 2020 · 4 comments
Closed

potential block when using proxy protocol #208

robklg opened this issue May 3, 2020 · 4 comments

Comments

@robklg
Copy link
Contributor

robklg commented May 3, 2020

In the proxy loop (ftpserver.rs), the function get_peer_from_proxy_header is called which blocks until the proxy header has completely been read. When for any reason this happens, new connections can not be accepted.

There are several angles to solve this that I've discussed and came up with together with @hannesdejager :

  • replace incoming connection handler with one that calls get_peer_from_proxy_header as well
  • spawn get_peer_from_proxy_header() in a async task, and use a channel to pass on the connection information + tcp stream back to the proxy loop
  • spawn get_peer_from_proxy_header() in a async task, and add this task to a specific task queue, that can then be watched from within the select!
  • spawn the hole incoming.next() arm in an async task, but that will require a concurrent hashmap to replace the current normal hashmap, including a performance penalty

In addition, a timeout must be introduced to make sure we close the connection if we do not receive the complete proxy header within x amount of time.

@Nigma1337
Copy link

I'm currently hitting this issue, when spawning unftp behind a digital ocean load balancer with proxy protocol enabled.

I'll get a connection, which will permanentely block any other connections. Seems like getting peer never ends.

Do you know about any work around, or is there something i can do to help finishing #209 ?

@robklg
Copy link
Contributor Author

robklg commented Sep 23, 2022

Hi @Nigma1337. Thank you for reaching out and offering to help. I'm sorry you run into this. I'm now working on a fix, and we intend to build a release this weekend. I hope and expect this fix to be in it. I'll keep you posted.

@Nigma1337
Copy link

Awesome! Apperciate it alot.

@hannesdejager
Copy link
Collaborator

Fixed in v0.18.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants