Enhancement #1649

If bus is busy cl-logger takes significant time to end

Added by Anonymous almost 8 years ago. Updated almost 8 years ago.

Status:ResolvedStart date:10/29/2013
Priority:LowDue date:
Assignee:J. Moringen% Done:

100%

Category:Common Lisp
Target version:rsb-0.10

Description

If the bus is busy (socket transport, ~100Hz, throughput ~5000), ending the logger takes a significant time (around 5-10 seconds). My setup is using rsb-logger-cl 0.9:
  1. One cl logger in monitor style is the socket server
  2. Another client makes 100 Hz traffic on the bus
  3. A cl logger is in detailed style with rst introspection

When I send Ctrl-C to 3., the detailed logger, it immediately stops printing, but takes 5-10 seconds to actually return. There is also a warning:

[ WARN (RSB.TOOLS.LOGGER) ]  Did not receive acknowledgment of shutdown handshake.

This is not a problem in using it at all, just an observation regarding the look and feel of the logger.

Associated revisions

Revision eb7a84d6
Added by J. Moringen almost 8 years ago

Fixed dispatch during shutdown in src/transport/socket/*.lisp

refs #1649

  • src/transport/socket/bus-connection.lisp
    (send-notification bus-connection cons): drop outgoing notifications
    when closing
    (handle bus-connection notification): lock the connection while
    sending outgoing notifications
  • src/transport/socket/bus.lisp (handle bus notification): only lock bus
    to copy connection list; do not lock during handling
    (handle bus cons): likewise

Revision e7b3a7d1
Added by J. Moringen almost 8 years ago

Fixed closing deadlock in src/transport/socket/bus.lisp

refs #1649

The deadlock could occur when connections where dispatching
events (locking the bus) while being removed (also locking the bus).

  • src/transport/socket/bus.lisp (bus::removed-connections): new slot;
    stores a list of connections queued for closing after having been
    removed
    (setf bus-connections :around list bus): remove handlers from closed
    connections; push removed connections onto `removed-connections' queue
    to close them later; error policy calls `close-removed-connections'
    (notify connector bus eql :detached): call `close-removed-connections'
    after releasing the bus locks
    (notify bus eql t eql :detached): cosmetic changes
    (close-removed-connections): new function; helper functions for
    closing connections after they have been removed from the bus

Revision e6e22147
Added by J. Moringen almost 8 years ago

Finish output before shutdown in src/transport/socket/bus-connection.lisp

refs #1649

  • src/transport/socket/bus-connection.lisp (handshake): call
    `finish-output' before shutting down the socket

Revision 66d81226
Added by J. Moringen almost 8 years ago

Backport: Fixed dispatch during shutdown in src/transport/socket/*.lisp

refs #1649

  • src/transport/socket/bus-connection.lisp
    (send-notification bus-connection cons): drop outgoing notifications
    when closing
    (handle bus-connection notification): lock the connection while
    sending outgoing notifications
  • src/transport/socket/bus.lisp (handle bus notification): only lock bus
    to copy connection list; do not lock during handling
    (handle bus cons): likewise

Revision 6b6b8bf5
Added by J. Moringen almost 8 years ago

Backport: Fixed closing deadlock in src/transport/socket/bus.lisp

refs #1649

The deadlock could occur when connections where dispatching
events (locking the bus) while being removed (also locking the bus).

  • src/transport/socket/bus.lisp (bus::removed-connections): new slot;
    stores a list of connections queued for closing after having been
    removed
    (setf bus-connections :around list bus): remove handlers from closed
    connections; push removed connections onto `removed-connections' queue
    to close them later; error policy calls `close-removed-connections'
    (notify connector bus eql :detached): call `close-removed-connections'
    after releasing the bus locks
    (notify bus eql t eql :detached): cosmetic changes
    (close-removed-connections): new function; helper functions for
    closing connections after they have been removed from the bus

Revision 34ba838e
Added by J. Moringen almost 8 years ago

Backport: Finish output before shutdown in src/transport/socket/bus-connection.lisp

refs #1649

  • src/transport/socket/bus-connection.lisp (handshake): call
    `finish-output' before shutting down the socket

History

#1 Updated by J. Moringen almost 8 years ago

  • Status changed from New to In Progress

#2 Updated by J. Moringen almost 8 years ago

  • Category changed from Common Lisp Tools to Common Lisp

#3 Updated by J. Moringen almost 8 years ago

  • % Done changed from 0 to 70

#4 Updated by J. Moringen almost 8 years ago

  • Status changed from In Progress to Feedback
  • Target version set to rsb-0.10
  • % Done changed from 70 to 90

Should be fixed in 0.9 and master. Please confirm.

#5 Updated by Anonymous almost 8 years ago

  • Status changed from Feedback to Resolved
  • % Done changed from 90 to 100

Confirmed with 0.9 and master.

Using the same setup, logger instantly stops and raises no warning.

Also available in: Atom PDF