Skip to content

Commit 07a7adb

Browse files
committed
Jira ticket: ALEPH-419
CRN with bad IPv6 config were having bad metrics, as /status/check/fastapi was too slow which looking further into it , came from /vm/63faf8b5db1cf8d965e6a464a0cb8062af8e7df131729e48738342d956f29ace/internet always taking 5 seconds, even if it ultimately returned positive resurlt. Coincidentally 5 seconds is the timeout configured in check_url inside the diagnostic vm (example_fastapi/main.py) To reproduce issue set the DNS server via environment variable ```env ALEPH_VM_DNS_NAMESERVERS = '[2001:41d0:3:163::1, 9.9.9.9]' ``` that ipv6 server being unreachable and set ip pool to default one ``` ALEPH_VM_IPV6_ADDRESS_POOL = fc00:1:2:3::/64 ``` Solution: Further analysis is that the diagnostic VM tried to connect to the ipv6 DNS server, did timout after 5 seconds then proceeded normally with the ipv4 DNS Put the ipv4 DNS server BEFORE the ipv6 one. Also disable the ipv6 server if ipv6 is not enabled for the VM. That modification was done for instances but failed to be reproduced for programs
1 parent c1967c6 commit 07a7adb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/aleph/vm/controllers/firecracker/program.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,13 +369,18 @@ async def _setup_configuration(
369369
authorized_keys = settings.DEVELOPER_SSH_KEYS
370370
else:
371371
authorized_keys = self.resources.message_content.authorized_keys
372+
nameservers_ip = []
373+
if ip:
374+
nameservers_ip = settings.DNS_NAMESERVERS_IPV4
375+
if ipv6:
376+
nameservers_ip += settings.DNS_NAMESERVERS_IPV6
372377

373378
program_config = ProgramConfiguration(
374379
ip=ip,
375380
ipv6=ipv6,
376381
route=route,
377382
ipv6_gateway=ipv6_gateway,
378-
dns_servers=settings.DNS_NAMESERVERS,
383+
dns_servers=nameservers_ip,
379384
code=code,
380385
encoding=self.resources.code_encoding,
381386
entrypoint=self.resources.code_entrypoint,

0 commit comments

Comments
 (0)