Skip to content

Warning spamming in Transport.onclose #538

Open
@ak-slongchamps

Description

@ak-slongchamps

Reproduction steps

  • Call autobahn.Connection.close on an active connection.
  • Observe the following is logged:
connection closed closed {
  reason: 'wamp.error.goodbye_and_out',
  message: '',
  retry_delay: null,
  retry_count: null,
  will_retry: false
}

This can be observed in the autobahn-js tests: https://travis-ci.org/github/crossbario/autobahn-js

✔ testConnect
connection closed closed { reason: 'wamp.close.normal',
  message: '',
  retry_delay: null,
  retry_count: null,
  will_retry: false }
CLOSE closed { reason: 'wamp.close.normal',
  message: '',
  retry_delay: null,
  retry_count: null,
  will_retry: false }
auto-reconnect disabled! false undefined
connection closed closed { reason: 'wamp.close.normal',
  message: '',
  retry_delay: null,
  retry_count: null,
  will_retry: false }

Tech Details

_session.leave is called in autobahn.Connection.close. Ultimately, Transport.onclose is being called when the connection is closed and this function logs a "connection closed {reason}" as a warning, when really this would only be a warning if the connection closed were a problematic state.

My suggestion is to simply use log.debug instead, as this spams stderr needlessly and can lead users to think that something went wrong on disconnection, when everything went well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions