The hunchentoot-stuck-connection-monitor Reference Manual

This is the hunchentoot-stuck-connection-monitor Reference Manual, version 1.0.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 06:26:01 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 hunchentoot-stuck-connection-monitor

Monitors hunchentoot connections and logs
the connections stuck in the same state for a long time (due to slow or inactive clients and network stream timeouts
that hunchentoot tries to utilize not working properly).

Offers an option to shutdown the stuck connections sockets manually or automatically, thus unblocking
the connection threads and preventing thread and socket leak.

See https://github.com/edicl/hunchentoot/issues/189

Author

Anton Vodonosov <>

License

BSD-2-Clause

Version

1.0.0

Dependencies
  • hunchentoot (system).
  • bordeaux-threads (system).
  • usocket (system).
Source

hunchentoot-stuck-connection-monitor.asd.

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.1 hunchentoot-stuck-connection-monitor/hunchentoot-stuck-connection-monitor.asd

Source

hunchentoot-stuck-connection-monitor.asd.

Parent Component

hunchentoot-stuck-connection-monitor (system).

ASDF Systems

hunchentoot-stuck-connection-monitor.


3.1.3 hunchentoot-stuck-connection-monitor/stuck-connection-monitor.lisp

Dependency

track-progress.lisp (file).

Source

hunchentoot-stuck-connection-monitor.asd.

Parent Component

hunchentoot-stuck-connection-monitor (system).

Packages

hunchentoot-stuck-connection-monitor.

Public Interface
Internals

3.1.4 hunchentoot-stuck-connection-monitor/acceptor-hook.lisp

Dependency

stuck-connection-monitor.lisp (file).

Source

hunchentoot-stuck-connection-monitor.asd.

Parent Component

hunchentoot-stuck-connection-monitor (system).

Public Interface

process-connection (method).


4 Packages

Packages are listed by definition order.


4.1 hunchentoot-stuck-connection-monitor

Source

stuck-connection-monitor.lisp.

Nickname

hunch-conn-mon

Use List

common-lisp.

Public Interface
Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Ordinary functions

Function: shutdown-stuck-connections (acceptor)
Package

hunchentoot-stuck-connection-monitor.

Source

stuck-connection-monitor.lisp.


5.1.2 Generic functions

Generic Reader: monitoring-interval-seconds (object)
Package

hunchentoot-stuck-connection-monitor.

Methods
Reader Method: monitoring-interval-seconds ((stuck-connection-monitor stuck-connection-monitor))

automatically generated reader method

Source

stuck-connection-monitor.lisp.

Target Slot

monitoring-interval-seconds.

Generic Writer: (setf monitoring-interval-seconds) (object)
Package

hunchentoot-stuck-connection-monitor.

Methods
Writer Method: (setf monitoring-interval-seconds) ((stuck-connection-monitor stuck-connection-monitor))

automatically generated writer method

Source

stuck-connection-monitor.lisp.

Target Slot

monitoring-interval-seconds.

Generic Reader: shutdown-sockets-automatically (object)
Package

hunchentoot-stuck-connection-monitor.

Methods
Reader Method: shutdown-sockets-automatically ((stuck-connection-monitor stuck-connection-monitor))

automatically generated reader method

Source

stuck-connection-monitor.lisp.

Target Slot

shutdown-sockets-automatically.

Generic Writer: (setf shutdown-sockets-automatically) (object)
Package

hunchentoot-stuck-connection-monitor.

Methods
Writer Method: (setf shutdown-sockets-automatically) ((stuck-connection-monitor stuck-connection-monitor))

automatically generated writer method

Source

stuck-connection-monitor.lisp.

Target Slot

shutdown-sockets-automatically.

Generic Function: stuck-timeout (acceptor)

Tells the monitor what time without progress indicates a stuck connection. NIL means no timeout.

Package

hunchentoot-stuck-connection-monitor.

Source

stuck-connection-monitor.lisp.

Methods
Method: stuck-timeout (acceptor)

5.1.3 Standalone methods

Method: process-connection ((*acceptor* stuck-connection-monitor) socket)
Package

hunchentoot.

Source

acceptor-hook.lisp.

Method: start :around ((monitor stuck-connection-monitor))
Package

hunchentoot.

Source

stuck-connection-monitor.lisp.

Method: stop :around ((monitor stuck-connection-monitor) &key soft)
Package

hunchentoot.

Source

stuck-connection-monitor.lisp.


5.1.4 Classes

Class: stuck-connection-monitor
Package

hunchentoot-stuck-connection-monitor.

Source

stuck-connection-monitor.lisp.

Direct methods
Direct slots
Slot: lock
Initform

(bordeaux-threads:make-lock "hunchentoot-stuck-connection-monitor.lock")

Readers

lock.

Writers

This slot is read-only.

Slot: records-by-socket
Type

hash-table

Initform

(make-hash-table :test (function eq))

Readers

records-by-socket.

Writers

(setf records-by-socket).

Slot: shutdown-sockets-automatically
Type

boolean

Initargs

:shutdown-sockets-automatically

Readers

shutdown-sockets-automatically.

Writers

(setf shutdown-sockets-automatically).

Slot: monitoring-interval-seconds
Type

(integer 0)

Initform

60

Initargs

:monitoring-interval-seconds

Readers

monitoring-interval-seconds.

Writers

(setf monitoring-interval-seconds).

Slot: thread
Type

(or null bordeaux-threads:thread)

Readers

thread.

Writers

(setf thread).

Slot: thread-running-p
Type

boolean

Readers

thread-running-p.

Writers

(setf thread-running-p).

Slot: stop-requested-p
Type

boolean

Readers

stop-requested-p.

Writers

(setf stop-requested-p).

Slot: stop-cond-var
Initform

(bordeaux-threads:make-condition-variable :name "hunchentoot-stuck-connection-monitor.stop-cond-var")

Readers

stop-cond-var.

Writers

This slot is read-only.


5.2 Internals


5.2.1 Special variables

Special Variable: *debug-enabled*
Package

hunchentoot-stuck-connection-monitor.

Source

stuck-connection-monitor.lisp.


5.2.2 Ordinary functions

Function: ensure-monitoring-thread-running (monitor)
Package

hunchentoot-stuck-connection-monitor.

Source

stuck-connection-monitor.lisp.

Function: hunch-log (acceptor level format-str &rest format-args)
Package

hunchentoot-stuck-connection-monitor.

Source

stuck-connection-monitor.lisp.

Function: log-debug (acceptor format-str &rest args)
Package

hunchentoot-stuck-connection-monitor.

Source

stuck-connection-monitor.lisp.

Function: log-info (acceptor format-str &rest format-args)
Package

hunchentoot-stuck-connection-monitor.

Source

stuck-connection-monitor.lisp.

Function: log-warn (acceptor format-str &rest format-args)
Package

hunchentoot-stuck-connection-monitor.

Source

stuck-connection-monitor.lisp.

Function: monitor-thread-body (monitor)
Package

hunchentoot-stuck-connection-monitor.

Source

stuck-connection-monitor.lisp.

Function: seconds-since (a-realtime)
Package

hunchentoot-stuck-connection-monitor.

Source

stuck-connection-monitor.lisp.

Function: should-stop-p (acceptor)
Package

hunchentoot-stuck-connection-monitor.

Source

stuck-connection-monitor.lisp.

Function: shutdown-socket (monitor record)
Package

hunchentoot-stuck-connection-monitor.

Source

stuck-connection-monitor.lisp.

Function: socket-description (socket)
Package

hunchentoot-stuck-connection-monitor.

Source

stuck-connection-monitor.lisp.

Function: timed-out-records (monitor)
Package

hunchentoot-stuck-connection-monitor.

Source

stuck-connection-monitor.lisp.

Function: wait-for-stop (monitor &key timeout-seconds)

Returns true if the MONINTOR’s thread should be stopped,
and false on timeout. As usually, the TIMEOUT-SECONDS can be fractional.

Package

hunchentoot-stuck-connection-monitor.

Source

stuck-connection-monitor.lisp.


5.2.3 Generic functions

Generic Reader: lock (object)
Package

hunchentoot-stuck-connection-monitor.

Methods
Reader Method: lock ((stuck-connection-monitor stuck-connection-monitor))

automatically generated reader method

Source

stuck-connection-monitor.lisp.

Target Slot

lock.

Generic Reader: records-by-socket (object)
Package

hunchentoot-stuck-connection-monitor.

Methods
Reader Method: records-by-socket ((stuck-connection-monitor stuck-connection-monitor))

automatically generated reader method

Source

stuck-connection-monitor.lisp.

Target Slot

records-by-socket.

Generic Writer: (setf records-by-socket) (object)
Package

hunchentoot-stuck-connection-monitor.

Methods
Writer Method: (setf records-by-socket) ((stuck-connection-monitor stuck-connection-monitor))

automatically generated writer method

Source

stuck-connection-monitor.lisp.

Target Slot

records-by-socket.

Generic Reader: stop-cond-var (object)
Package

hunchentoot-stuck-connection-monitor.

Methods
Reader Method: stop-cond-var ((stuck-connection-monitor stuck-connection-monitor))

automatically generated reader method

Source

stuck-connection-monitor.lisp.

Target Slot

stop-cond-var.

Generic Reader: stop-requested-p (object)
Package

hunchentoot-stuck-connection-monitor.

Methods
Reader Method: stop-requested-p ((stuck-connection-monitor stuck-connection-monitor))

automatically generated reader method

Source

stuck-connection-monitor.lisp.

Target Slot

stop-requested-p.

Generic Writer: (setf stop-requested-p) (object)
Package

hunchentoot-stuck-connection-monitor.

Methods
Writer Method: (setf stop-requested-p) ((stuck-connection-monitor stuck-connection-monitor))

automatically generated writer method

Source

stuck-connection-monitor.lisp.

Target Slot

stop-requested-p.

Generic Reader: thread (object)
Package

hunchentoot-stuck-connection-monitor.

Methods
Reader Method: thread ((stuck-connection-monitor stuck-connection-monitor))

automatically generated reader method

Source

stuck-connection-monitor.lisp.

Target Slot

thread.

Generic Writer: (setf thread) (object)
Package

hunchentoot-stuck-connection-monitor.

Methods
Writer Method: (setf thread) ((stuck-connection-monitor stuck-connection-monitor))

automatically generated writer method

Source

stuck-connection-monitor.lisp.

Target Slot

thread.

Generic Reader: thread-running-p (object)
Package

hunchentoot-stuck-connection-monitor.

Methods
Reader Method: thread-running-p ((stuck-connection-monitor stuck-connection-monitor))

automatically generated reader method

Source

stuck-connection-monitor.lisp.

Target Slot

thread-running-p.

Generic Writer: (setf thread-running-p) (object)
Package

hunchentoot-stuck-connection-monitor.

Methods
Writer Method: (setf thread-running-p) ((stuck-connection-monitor stuck-connection-monitor))

automatically generated writer method

Source

stuck-connection-monitor.lisp.

Target Slot

thread-running-p.


5.2.4 Standalone methods

Method: track-progress (socket new-state-name (acceptor stuck-connection-monitor))
Package

hunchentoot.

Source

stuck-connection-monitor.lisp.


5.2.5 Classes

Class: record
Package

hunchentoot-stuck-connection-monitor.

Source

stuck-connection-monitor.lisp.

Direct slots
Slot: socket
Initargs

:socket

Slot: description
Type

string

Initargs

:description

Slot: state
Type

keyword

Initargs

:state

Slot: state-enter-realtime
Initargs

:state-enter-realtime

Slot: thread
Type

bordeaux-threads:thread

Initargs

:thread

Slot: socket-shutdown-realtime
Type

(or null (integer 0))


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
E   F   G   H   L   M   P   R   S   T   W  
Index Entry  Section

(
(setf monitoring-interval-seconds): Public generic functions
(setf monitoring-interval-seconds): Public generic functions
(setf records-by-socket): Private generic functions
(setf records-by-socket): Private generic functions
(setf shutdown-sockets-automatically): Public generic functions
(setf shutdown-sockets-automatically): Public generic functions
(setf stop-requested-p): Private generic functions
(setf stop-requested-p): Private generic functions
(setf thread): Private generic functions
(setf thread): Private generic functions
(setf thread-running-p): Private generic functions
(setf thread-running-p): Private generic functions

E
ensure-monitoring-thread-running: Private ordinary functions

F
Function, ensure-monitoring-thread-running: Private ordinary functions
Function, hunch-log: Private ordinary functions
Function, log-debug: Private ordinary functions
Function, log-info: Private ordinary functions
Function, log-warn: Private ordinary functions
Function, monitor-thread-body: Private ordinary functions
Function, seconds-since: Private ordinary functions
Function, should-stop-p: Private ordinary functions
Function, shutdown-socket: Private ordinary functions
Function, shutdown-stuck-connections: Public ordinary functions
Function, socket-description: Private ordinary functions
Function, timed-out-records: Private ordinary functions
Function, wait-for-stop: Private ordinary functions

G
Generic Function, (setf monitoring-interval-seconds): Public generic functions
Generic Function, (setf records-by-socket): Private generic functions
Generic Function, (setf shutdown-sockets-automatically): Public generic functions
Generic Function, (setf stop-requested-p): Private generic functions
Generic Function, (setf thread): Private generic functions
Generic Function, (setf thread-running-p): Private generic functions
Generic Function, lock: Private generic functions
Generic Function, monitoring-interval-seconds: Public generic functions
Generic Function, records-by-socket: Private generic functions
Generic Function, shutdown-sockets-automatically: Public generic functions
Generic Function, stop-cond-var: Private generic functions
Generic Function, stop-requested-p: Private generic functions
Generic Function, stuck-timeout: Public generic functions
Generic Function, thread: Private generic functions
Generic Function, thread-running-p: Private generic functions

H
hunch-log: Private ordinary functions

L
lock: Private generic functions
lock: Private generic functions
log-debug: Private ordinary functions
log-info: Private ordinary functions
log-warn: Private ordinary functions

M
Method, (setf monitoring-interval-seconds): Public generic functions
Method, (setf records-by-socket): Private generic functions
Method, (setf shutdown-sockets-automatically): Public generic functions
Method, (setf stop-requested-p): Private generic functions
Method, (setf thread): Private generic functions
Method, (setf thread-running-p): Private generic functions
Method, lock: Private generic functions
Method, monitoring-interval-seconds: Public generic functions
Method, process-connection: Public standalone methods
Method, records-by-socket: Private generic functions
Method, shutdown-sockets-automatically: Public generic functions
Method, start: Public standalone methods
Method, stop: Public standalone methods
Method, stop-cond-var: Private generic functions
Method, stop-requested-p: Private generic functions
Method, stuck-timeout: Public generic functions
Method, thread: Private generic functions
Method, thread-running-p: Private generic functions
Method, track-progress: Private standalone methods
monitor-thread-body: Private ordinary functions
monitoring-interval-seconds: Public generic functions
monitoring-interval-seconds: Public generic functions

P
process-connection: Public standalone methods

R
records-by-socket: Private generic functions
records-by-socket: Private generic functions

S
seconds-since: Private ordinary functions
should-stop-p: Private ordinary functions
shutdown-socket: Private ordinary functions
shutdown-sockets-automatically: Public generic functions
shutdown-sockets-automatically: Public generic functions
shutdown-stuck-connections: Public ordinary functions
socket-description: Private ordinary functions
start: Public standalone methods
stop: Public standalone methods
stop-cond-var: Private generic functions
stop-cond-var: Private generic functions
stop-requested-p: Private generic functions
stop-requested-p: Private generic functions
stuck-timeout: Public generic functions
stuck-timeout: Public generic functions

T
thread: Private generic functions
thread: Private generic functions
thread-running-p: Private generic functions
thread-running-p: Private generic functions
timed-out-records: Private ordinary functions
track-progress: Private standalone methods

W
wait-for-stop: Private ordinary functions


A.4 Data types

Jump to:   A   C   F   H   P   R   S   T  
Index Entry  Section

A
acceptor-hook.lisp: The hunchentoot-stuck-connection-monitor/acceptor-hook․lisp file

C
Class, record: Private classes
Class, stuck-connection-monitor: Public classes

F
File, acceptor-hook.lisp: The hunchentoot-stuck-connection-monitor/acceptor-hook․lisp file
File, hunchentoot-stuck-connection-monitor.asd: The hunchentoot-stuck-connection-monitor/hunchentoot-stuck-connection-monitor․asd file
File, stuck-connection-monitor.lisp: The hunchentoot-stuck-connection-monitor/stuck-connection-monitor․lisp file
File, track-progress.lisp: The hunchentoot-stuck-connection-monitor/track-progress․lisp file

H
hunchentoot-stuck-connection-monitor: The hunchentoot-stuck-connection-monitor system
hunchentoot-stuck-connection-monitor: The hunchentoot-stuck-connection-monitor package
hunchentoot-stuck-connection-monitor.asd: The hunchentoot-stuck-connection-monitor/hunchentoot-stuck-connection-monitor․asd file

P
Package, hunchentoot-stuck-connection-monitor: The hunchentoot-stuck-connection-monitor package

R
record: Private classes

S
stuck-connection-monitor: Public classes
stuck-connection-monitor.lisp: The hunchentoot-stuck-connection-monitor/stuck-connection-monitor․lisp file
System, hunchentoot-stuck-connection-monitor: The hunchentoot-stuck-connection-monitor system

T
track-progress.lisp: The hunchentoot-stuck-connection-monitor/track-progress․lisp file