hedgedoc / hedgedoc

HedgeDoc - Ideas grow better together

Home Page:https://hedgedoc.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Continuously growing Sessions table

yurenchen000 opened this issue · comments

Description

Version

image: quay.io/hedgedoc/hedgedoc:1.9.9

Detail

docker healthcheck every 15 seconds (seems)

each time access $HOST:$PORT/_health (or any page else)
for example: curl -sv 127.1:3000/_health

It'll record a session into Sessions table.

then this table Continuously growing...

psql> select "createdAt" from "Sessions" order by "createdAt" desc;
         createdAt          
----------------------------
 2024-01-26 16:28:02.192+00
 2024-01-26 16:27:47.066+00
 2024-01-26 16:27:31.934+00
 2024-01-26 16:27:16.811+00
 2024-01-26 16:27:01.688+00
 2024-01-26 16:26:46.558+00
 2024-01-26 16:26:31.436+00
 2024-01-26 16:26:16.31+00
 2024-01-26 16:26:01.194+00
 2024-01-26 16:25:46.065+00
 2024-01-26 16:25:30.942+00
 2024-01-26 16:25:15.803+00
 2024-01-26 16:25:00.671+00
 2024-01-26 16:24:45.552+00
 2024-01-26 16:24:30.435+00
 2024-01-26 16:24:15.316+00
 2024-01-26 16:24:00.203+00
 2024-01-26 16:23:45.077+00
 2024-01-26 16:23:29.928+00
 2024-01-26 16:23:14.813+00
 2024-01-26 16:22:59.689+00
 2024-01-26 16:22:44.567+00
 2024-01-26 16:22:29.419+00
 2024-01-26 16:22:14.29+00
 2024-01-26 16:21:59.156+00
 ...

Steps to reproduce

  1. deploy via docker compose
    https://docs.hedgedoc.org/setup/docker
    image: quay.io/hedgedoc/hedgedoc:1.9.9

  2. do nothing, just check Sessions table
    Up to 5,000 new records added every day

Expected behaviour

Should not keep growing, Maybe ?

Logs

No response

Config

No response

Your Setup

  • Host OS: [e.g. Ubuntu 20.04]
  • NodeJS version: [run node --version]
  • HedgeDoc version: (Click "Releases" in the footer)

Additional context

No response

Temporary workaround: disable health check

## in container
$ mv -iv healthcheck.mjs healthcheck.mjs_bak

OR

## in compose.yml
services:
  ...
  app:
    healthcheck:
      test: ['CMD','true']

You're right, this should be fixed.
It seems the exclusion for session creation was forgotten when the /_health endpoint was added.

https://github.com/hedgedoc/hedgedoc/blob/master/app.js#L155