diff --git a/CHANGELOG.md b/CHANGELOG.md index ead70b7..2494d6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## 4.4.3 / 2024.10.04 + +* [BUGFIX] Use correct buffer size for unix sockets. See [#256][] + ## 4.4.2 / 2024.06.03 * [BUGFIX] Fix sampling and visibility issues with new direct client. See [#249][] @@ -254,6 +258,7 @@ Fork from [indeedeng/java-dogstatsd-client] (https://github.com/indeedeng/java-d [#243]: https://github.com/DataDog/java-dogstatsd-client/issues/243 [#247]: https://github.com/DataDog/java-dogstatsd-client/issues/247 [#249]: https://github.com/DataDog/java-dogstatsd-client/issues/249 +[#256]: https://github.com/DataDog/java-dogstatsd-client/issues/256 [@PatrickAuld]: https://github.com/PatrickAuld diff --git a/README.md b/README.md index 97dd394..c1dc119 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ The client jar is distributed via Maven central, and can be downloaded [from Mav com.datadoghq java-dogstatsd-client - 4.4.2 + 4.4.3 ``` diff --git a/pom.xml b/pom.xml index 0cbb3e9..c816a34 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ java-dogstatsd-client jar java-dogstatsd-client - 4.4.2 + 4.4.3 A tiny library allowing Java applications to communicate with DataDog statsd instances easily. https://github.com/DataDog/java-dogstatsd-client diff --git a/src/test/java/com/timgroup/statsd/UnixStreamSocketTest.java b/src/test/java/com/timgroup/statsd/UnixStreamSocketTest.java index 7b72132..ae0ad5d 100644 --- a/src/test/java/com/timgroup/statsd/UnixStreamSocketTest.java +++ b/src/test/java/com/timgroup/statsd/UnixStreamSocketTest.java @@ -34,6 +34,11 @@ public synchronized void handle(Exception exception) { lastException = exception; } + synchronized boolean lastExceptionMessageContains(String s) { + String msg = lastException.getMessage(); + return msg != null && msg.contains(s); + } + @BeforeClass public static void supportedOnly() throws IOException { Assume.assumeTrue(TestHelpers.isUdsAvailable()); @@ -108,22 +113,19 @@ public void resist_dsd_restart() throws Exception { // Close the server, client should throw an IOException server.close(); - while(lastException.getMessage() == null) { + while(!lastExceptionMessageContains("Connection refused")) { client.gauge("mycount", 20); Thread.sleep(10); } - // Depending on the state of the client at that point we might get different messages. - assertThat(lastException.getMessage(), anyOf(containsString("Connection refused"), containsString("Broken pipe"))); // Delete the socket file, client should throw an IOException lastException = new Exception(); socketFile.delete(); client.gauge("mycount", 21); - while(lastException.getMessage() == null) { + while(!lastExceptionMessageContains("No such file or directory")) { Thread.sleep(10); } - assertThat(lastException.getMessage(), containsString("No such file or directory")); // Re-open the server, next send should work OK DummyStatsDServer server2;