diff --git a/README.md b/README.md index e1a87fab..314bbf2e 100644 --- a/README.md +++ b/README.md @@ -199,7 +199,20 @@ make install # will install to /usr/local on Unix, on macOS it is a good idea to Headers and a static library will be installed to the target dir. -There is a Dockerfile for running some code on Linux, and a unittest which can be executed by typing `make test`. +There is a unittest which can be executed by typing `make test`. + +There is a Dockerfile for running some code on Linux. To use docker-compose you must make a docker container first. + +``` +$ make docker +... +$ docker compose up & +... +$ docker exec -it ixwebsocket_ws_1 bash +app@ca2340eb9106:~$ ws --help +ws is a websocket tool +... +``` Finally you can build and install the `ws command line tool` with Homebrew. The homebrew version might be slightly out of date. diff --git a/docker-compose.yml b/docker-compose.yml index c1c7eb13..574928f0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,6 +11,10 @@ services: - redis1 ws: + security_opt: + - seccomp:unconfined + cap_add: + - SYS_PTRACE stdin_open: true tty: true image: bsergean/ws:build diff --git a/makefile b/makefile index 1f30cf88..afca75ca 100644 --- a/makefile +++ b/makefile @@ -31,7 +31,7 @@ docker_push: docker push ${LATEST} run: - docker run --cap-add sys_ptrace -it ws:latest + docker run --cap-add sys_ptrace --entrypoint=bash -it bsergean/ws:build # this is helpful to remove trailing whitespaces trail: diff --git a/ws/ws_cobra_publish.cpp b/ws/ws_cobra_publish.cpp index e42bbeef..62b4d85f 100644 --- a/ws/ws_cobra_publish.cpp +++ b/ws/ws_cobra_publish.cpp @@ -53,10 +53,12 @@ namespace ix { cobraMetricsPublisher.push(channel, data); } - cobraMetricsPublisher.suspend(); - std::this_thread::sleep_for(std::chrono::milliseconds(100)); + cobraMetricsPublisher.suspend(); cobraMetricsPublisher.resume(); + + // FIXME: investigate why without this check we trigger a lock + while (!cobraMetricsPublisher.isAuthenticated()) ; } }