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

CODENVY-457: fix NPE when swarm doesn't detect container death #1344

Merged
merged 4 commits into from
May 24, 2016

Conversation

garagatyi
Copy link

@skabashnyuk Please review

Signed-off-by: Alexander Garagatyi <agaragatyi@codenvy.com>
throw e;
}
Map<String, List<PortBinding>> ports = info.getNetworkSettings().getPorts();
Map<String, String> labels = info.getConfig().getLabels();
Copy link
Contributor

Choose a reason for hiding this comment

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

are you sure getNetworkSettings and getConfig are not null?

Copy link
Author

Choose a reason for hiding this comment

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

Looks like they are never null whereas ports field is null when container is not running

@skabashnyuk
Copy link
Contributor

ok

@garagatyi
Copy link
Author

@skabashnyuk Please take a look

// Hack needed to investigate why swarm returns invalid response
LOG.error(info.toString());
throw e;
Map<String, List<PortBinding>> ports = Collections.emptyMap();
Copy link
Contributor

Choose a reason for hiding this comment

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

is that Collections.emptyMap shouldn't be created in the else block ?

Copy link
Author

Choose a reason for hiding this comment

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

done

@skabashnyuk
Copy link
Contributor

ok

@garagatyi garagatyi merged commit 5c1c502 into 4.2.x May 24, 2016
@garagatyi garagatyi deleted the npefixswarmbug branch May 24, 2016 14:08
@benoitf
Copy link
Contributor

benoitf commented May 24, 2016

will it be backported to 4.3.x as well ? replacing/updating #1312

@garagatyi
Copy link
Author

yes/yes

@benoitf
Copy link
Contributor

benoitf commented May 24, 2016

nice to see this NPE gone

@codenvy-ci
Copy link

Build # 696 - FAILED

Please check console output at http://ci.codenvy-dev.com/jenkins/job/che-pullrequests-build/696/ to view the results.

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.

4 participants