Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[auto_discovery] process templates larger than the page buffer size #145

Merged
merged 5 commits into from
Jul 11, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
[auto-discovery] only fall into the auto-discovering if there's somet…
…hing in the pipe.
truthbk committed Jul 11, 2017
commit 3e304d06b527f0fc463d15ef49288e1505444e6f
4 changes: 2 additions & 2 deletions src/main/java/org/datadog/jmxfetch/App.java
Original file line number Diff line number Diff line change
@@ -249,7 +249,7 @@ void start() {
adPipe = newAutoDiscoveryPipe();
}
try {
if(adPipe != null) {
if(adPipe != null && adPipe.available() > 0) {
byte[] buffer = new byte[0];
boolean terminated = false;
while (!terminated) {
@@ -261,7 +261,7 @@ void start() {
// The separator always comes in its own atomic write() from the agent side -
// so it will never be chopped.
if (Bytes.indexOf(minibuff, App.AD_LEGACY_CONFIG_TERM.getBytes()) > -1 ||
Bytes.indexOf(minibuff, App.AD_CONFIG_TERM.getBytes()) > -1 ) {
Bytes.indexOf(minibuff, App.AD_CONFIG_TERM.getBytes()) > -1 ) {
terminated = true;
}