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

Add information about nio channels in logs #26806

Merged
merged 7 commits into from
Sep 28, 2017

Conversation

Tim-Brooks
Copy link
Contributor

Currently we only log generic messages about errors from the
nio event handler. This means that we do not know which channel had
issues connection, reading, writing, etc.

This commit changes the logs to include the local and remote addresses
and profile for a channel.

Currently we only log generic messages about errors in logs from the
nio event handler. This means that we do not know which channel had
issues connection, reading, writing, etc.

This commit changes the logs to include the local and remote addresses
and profile for a channel.
Copy link
Member

@jasontedor jasontedor left a comment

Choose a reason for hiding this comment

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

I left one comment, otherwise LGTM.

public void acceptException(NioServerSocketChannel nioServerChannel, Exception exception) {
logger.debug("exception while accepting new channel", exception);
void acceptException(NioServerSocketChannel nioServerChannel, Exception exception) {
logger.debug(new ParameterizedMessage("exception while accepting new channel from server channel: {}",
Copy link
Member

Choose a reason for hiding this comment

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

Since this is at the debug level, should you use a supplier here to avoid instantiating the parameterized message if not needed?

public void genericServerChannelException(NioServerSocketChannel channel, Exception exception) {
logger.debug("event handling exception", exception);
void genericServerChannelException(NioServerSocketChannel channel, Exception exception) {
logger.debug(new ParameterizedMessage("exception while handling event for server channel: {}", channel), exception);
Copy link
Member

Choose a reason for hiding this comment

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

Since this is at the debug level, should you use a supplier here to avoid instantiating the parameterized message if not needed?

* @param exception that occurred
*/
void closeException(NioChannel channel, Exception exception) {
logger.debug(new ParameterizedMessage("exception while closing channel: {}", channel), exception);
Copy link
Member

Choose a reason for hiding this comment

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

Since this is at the debug level, should you use a supplier here to avoid instantiating the parameterized message if not needed?

public void registrationException(NioSocketChannel channel, Exception exception) {
logger.trace("failed to register channel", exception);
void registrationException(NioSocketChannel channel, Exception exception) {
logger.debug(new ParameterizedMessage("failed to register socket channel: {}", channel), exception);
Copy link
Member

Choose a reason for hiding this comment

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

Since this is at the debug level, should you use a supplier here to avoid instantiating the parameterized message if not needed?

public void connectException(NioSocketChannel channel, Exception exception) {
logger.trace("failed to connect to channel", exception);
void connectException(NioSocketChannel channel, Exception exception) {
logger.debug(new ParameterizedMessage("failed to connect to socket channel: {}", channel), exception);
Copy link
Member

Choose a reason for hiding this comment

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

Since this is at the debug level, should you use a supplier here to avoid instantiating the parameterized message if not needed?

public void readException(NioSocketChannel channel, Exception exception) {
logger.trace("failed to read from channel", exception);
void readException(NioSocketChannel channel, Exception exception) {
logger.debug(new ParameterizedMessage("exception while reading from socket channel: {}", channel), exception);
Copy link
Member

Choose a reason for hiding this comment

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

Since this is at the debug level, should you use a supplier here to avoid instantiating the parameterized message if not needed?

public void writeException(NioSocketChannel channel, Exception exception) {
logger.trace("failed to write to channel", exception);
void writeException(NioSocketChannel channel, Exception exception) {
logger.debug(new ParameterizedMessage("exception while writing to socket channel: {}", channel), exception);
Copy link
Member

Choose a reason for hiding this comment

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

Since this is at the debug level, should you use a supplier here to avoid instantiating the parameterized message if not needed?

public void genericChannelException(NioSocketChannel channel, Exception exception) {
logger.trace("event handling failed", exception);
void genericChannelException(NioSocketChannel channel, Exception exception) {
logger.debug(new ParameterizedMessage("exception while handling event for socket channel: {}", channel), exception);
Copy link
Member

Choose a reason for hiding this comment

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

Since this is at the debug level, should you use a supplier here to avoid instantiating the parameterized message if not needed?

@Tim-Brooks Tim-Brooks merged commit bf403ae into elastic:master Sep 28, 2017
Tim-Brooks added a commit that referenced this pull request Sep 29, 2017
Currently we only log generic messages about errors in logs from the
nio event handler. This means that we do not know which channel had
issues connection, reading, writing, etc.

This commit changes the logs to include the local and remote addresses
and profile for a channel.
@Tim-Brooks Tim-Brooks deleted the handler_tracking branch November 14, 2018 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Coordination/Network Http and internode communication implementations >non-issue v6.1.0 v7.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants