Skip to content

secondary server, mirage layer - #347

Merged
reynir merged 3 commits into
mirage:mainfrom
hannesm:secondary-avoid-synflood
Dec 6, 2023
Merged

secondary server, mirage layer#347
reynir merged 3 commits into
mirage:mainfrom
hannesm:secondary-avoid-synflood

Conversation

@hannesm

@hannesm hannesm commented Nov 28, 2023

Copy link
Copy Markdown
Member

If there's a (Dns_server.Secondary.)timer-triggered connection request, do not infinitely try to connect (via request -> fail -> close -> request) in a tight loop, but cancel on first sight (the timer is responsible for re-connecting)

I'm in the process of testing this in production.

If there's a (Dns_server.Secondary.)timer-triggered connection request, do not
infinitely try to connect (via request -> fail -> close -> request) in a tight
loop, but cancel on first sight (the timer is responsible for re-connecting)

@reynir reynir left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. I have some suggestions.

Comment thread mirage/server/dns_server_mirage.ml Outdated
@hannesm

hannesm commented Nov 28, 2023

Copy link
Copy Markdown
Member Author

I think the entire dns_server_mirage and dns_mirage logic may need an overhaul with a view on when which failures may arise, and how to properly handle them (to avoid such tight loops). maybe timer is the only thing, though...

Comment thread mirage/server/dns_server_mirage.ml
@reynir

reynir commented Dec 6, 2023

Copy link
Copy Markdown
Member

I think this improves the situation so I will merge. If there are unintended effects we can revisit.

@reynir
reynir merged commit c67ac0e into mirage:main Dec 6, 2023
@hannesm
hannesm deleted the secondary-avoid-synflood branch December 6, 2023 10:16
@hannesm
hannesm restored the secondary-avoid-synflood branch December 6, 2023 10:16
hannesm added a commit to hannesm/opam-repository that referenced this pull request May 29, 2024
CHANGES:

* dns-client (lwt, mirage): depend on happy-eyeballs-{lwt,mirage} instead of
  duplicating the code. This requires happy-eyeballs 1.1.0, and now the same
  Happy_eyeballs_{lwt,mirage}.t is used for DNS (connecting to the nameserver)
  and for the application (connecting to a remote host)
  (@dinosaure @hannesm mirage/ocaml-dns#346)
* server: improve API documentation (@hannesm
  1a80bd4080e597687152cf351d035ef5f00c5946
  000ae02dfc477d91c05891e3891a447328ae448a)
* server: add a `packet_callback` to `handle_packet` and `handle_buf`
  (@RyanGibb mirage/ocaml-dns#349)
* server: expose `update_data` (@RyanGibb mirage/ocaml-dns#350)
* resolver: b root name server IP change (@hannesm mirage/ocaml-dns#348)
* secondary server [mirage]: avoid infinite loop in connect (avoids SYN floods)
  (@hannesm @reynir mirage/ocaml-dns#347)
* resolver, dns_zone: use consistently `Log` instead of `Logs` (@palainp mirage/ocaml-dns#342)
avsm pushed a commit to avsm/opam-repository that referenced this pull request Sep 5, 2024
CHANGES:

* dns-client (lwt, mirage): depend on happy-eyeballs-{lwt,mirage} instead of
  duplicating the code. This requires happy-eyeballs 1.1.0, and now the same
  Happy_eyeballs_{lwt,mirage}.t is used for DNS (connecting to the nameserver)
  and for the application (connecting to a remote host)
  (@dinosaure @hannesm mirage/ocaml-dns#346)
* server: improve API documentation (@hannesm
  1a80bd4080e597687152cf351d035ef5f00c5946
  000ae02dfc477d91c05891e3891a447328ae448a)
* server: add a `packet_callback` to `handle_packet` and `handle_buf`
  (@RyanGibb mirage/ocaml-dns#349)
* server: expose `update_data` (@RyanGibb mirage/ocaml-dns#350)
* resolver: b root name server IP change (@hannesm mirage/ocaml-dns#348)
* secondary server [mirage]: avoid infinite loop in connect (avoids SYN floods)
  (@hannesm @reynir mirage/ocaml-dns#347)
* resolver, dns_zone: use consistently `Log` instead of `Logs` (@palainp mirage/ocaml-dns#342)
RyanGibb added a commit to RyanGibb/ocaml-dns that referenced this pull request Nov 18, 2024
Release 8.0.0

CHANGES:

* dns-client (lwt, mirage): depend on happy-eyeballs-{lwt,mirage} instead of
  duplicating the code. This requires happy-eyeballs 1.1.0, and now the same
  Happy_eyeballs_{lwt,mirage}.t is used for DNS (connecting to the nameserver)
  and for the application (connecting to a remote host)
  (@dinosaure @hannesm mirage#346)
* server: improve API documentation (@hannesm
  1a80bd4
  000ae02)
* server: add a `packet_callback` to `handle_packet` and `handle_buf`
  (@RyanGibb mirage#349)
* server: expose `update_data` (@RyanGibb mirage#350)
* resolver: b root name server IP change (@hannesm mirage#348)
* secondary server [mirage]: avoid infinite loop in connect (avoids SYN floods)
  (@hannesm @reynir mirage#347)
* resolver, dns_zone: use consistently `Log` instead of `Logs` (@palainp mirage#342)
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 this pull request may close these issues.

2 participants