Skip to content

Comments

Add container with pre-stop hook script.#5

Merged
sysvinit merged 4 commits intowireappfrom
sysvinit/wireapp-docker-image
Jun 8, 2022
Merged

Add container with pre-stop hook script.#5
sysvinit merged 4 commits intowireappfrom
sysvinit/wireapp-docker-image

Conversation

@sysvinit
Copy link

@sysvinit sysvinit commented Jun 7, 2022

We need to be able to detect traffic drain conditions when performing graceful restarts of coturn. This change adds a container image definition which derives from another Debian-based coturn image, and adds a script to the image which polls the metrics endpoint until the number of active allocations reaches zero.

Edit: I've tested this image, and it does seem to work correctly as a replacement for existing usages of our coturn image.

This adds a container image derived from the Debian coturn image which includes
a pre-stop hook script. This hook script polls the Prometheus metrics endpoint
and waits until the number of active allocations reaches zero. This can be used
to detect when traffic is drained from a running coturn instance, in order to
perform a non-invasive graceful restart.
Copy link
Collaborator

@supersven supersven left a comment

Choose a reason for hiding this comment

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

All comments solved.

@sysvinit sysvinit merged commit d102473 into wireapp Jun 8, 2022
@sysvinit sysvinit deleted the sysvinit/wireapp-docker-image branch June 8, 2022 14:30
sysvinit pushed a commit that referenced this pull request Nov 8, 2022
```
==6418==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x4e7530 in bcmp /src/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc:906:10
    #1 0x55463d in stun_check_message_integrity_by_key_str coturn/src/client/ns_turn_msg.c:1989:5
    #2 0x554acc in stun_check_message_integrity_str coturn/src/client/ns_turn_msg.c:2008:9
    #3 0x5358c0 in LLVMFuzzerTestOneInput coturn/fuzz/FuzzStun.c:37:5
    #4 0x43ede3 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15
    #5 0x42a542 in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:324:6
    #6 0x42fdec in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:860:9
    #7 0x459322 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
    #8 0x7f4cb21790b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/libc-start.c:308:16
    #9 0x42070d in _start
  Uninitialized value was created by an allocation of 'new_hmac' in the stack frame of function 'stun_check_message_integrity_by_key_str'
    #0 0x5538c0 in stun_check_message_integrity_by_key_str coturn/src/client/ns_turn_msg.c:1927
```
sysvinit added a commit that referenced this pull request Nov 8, 2022
* Add docker image which includes pre-stop hook script.

This adds a container image derived from the Debian coturn image which includes
a pre-stop hook script. This hook script polls the Prometheus metrics endpoint
and waits until the number of active allocations reaches zero. This can be used
to detect when traffic is drained from a running coturn instance, in order to
perform a non-invasive graceful restart.

* Change shebang to bash.

* Add status reporting to pre-stop hook script.

* Add some explanatory commentary to the wireapp Dockerfile.
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