BeamMP-Server icon indicating copy to clipboard operation
BeamMP-Server copied to clipboard

Please reduce update reminder console spam

Open juniper-folf opened this issue 1 year ago • 14 comments

Whenever there's a new version, the server prints an update reminder every 30 seconds or so. I believe there's a bug in src/THeartbeatThread.cpp:132:

    if (!Application::Settings.HideUpdateMessages && UpdateReminderCounter % 5) {

where the server is supposed to check for updates every 5th heartbeat but instead it's checking it on every HB except the 5th ones (I might be wrong, I have very little experience with C++). But even the (I assume) intended period of 2.5 minutes seems pretty spammy, especially for small servers which don't see much traffic, where it would still outnumber all other ouput by an extreme margin.

Is it possible to reduce the frequency of update reminders? Ideally having a parameter that would set the period manually in a configuration file (or at least a switch between minute-interval and day-interval reminders).

Setting the "ImScaredOfUpdates" flag in ServerConfig.toml gets rid of this issue, however it disables update reminders completely when the server is running. I run my server continuously in a detached tmux instance so I don't restart it for weeks or months at a time (usually until there's a kernel update when I have to restart the system) so I do want to be reminded when there's a new version out.

I'm using the Debian 12 build, but I don't think that's relevant here.

Acceptance criteria

  • [ ] fix bug in update reminder to print every 5 heartbeats
  • [ ] reduce update reminder to once every 3 or 6 hours on major versions (breaking changes) as we cant expect people to update immediately
  • [ ] Update reminder frequency setting with predefined values, like "hourly" and "daily" or something

juniper-folf avatar May 12 '24 21:05 juniper-folf

I would recommend updating to fix this issue. You are correct there is a bug, and that'll be fixed.

But really: Update the server. These are minor/patch updates which will not break your existing configuration, mods, plugins etc.

these updates are usually crash fixes and security fixes, you definitely want them.

lionkor avatar May 13 '24 10:05 lionkor

But yeah youre right about that bug! Thanks for finding it

lionkor avatar May 13 '24 10:05 lionkor

For whoever tackles this, acceptance criteria are:

  • [ ] fix bug in update reminder to print every 5 heartbeats
  • [ ] reduce update reminder to once every 3 or 6 hours on major versions (breaking changes) as we cant expect people to update immediately

lionkor avatar May 13 '24 10:05 lionkor

Hello, I do update the server regularly, which is why I don't want to use the ImScaredOfUpdates flag. But I only get around checking on it every week or so, so if I miss the new release by more than ~12 hours, the console is full of the update reminders and everything else is gone. For usecases like mine a reminder once per day would be frequent enough as I'm only running the server for a couple of friends and it doesn't see much traffic (maybe like one playsession a week)

I do genuinely appreciate all the updates and the hard work you're putting into this project, thank you!

juniper-folf avatar May 13 '24 10:05 juniper-folf

That makes sense. Then we also want:

  • [ ] Update reminder frequency setting with predefined values, like "hourly" and "daily" or something

lionkor avatar May 13 '24 10:05 lionkor

@sla-ppy or @jimkoen this is a good issue if one of you wants to ;)

lionkor avatar May 13 '24 10:05 lionkor

To summarize acceptance criteria:

  • [ ] fix bug in update reminder to print every 5 heartbeats
  • [ ] reduce update reminder to once every 3 or 6 hours on major versions (breaking changes) as we cant expect people to update immediately
  • [ ] Update reminder frequency setting with predefined values, like "hourly" and "daily" or something

jimkoen avatar May 13 '24 11:05 jimkoen

Possible Idea:

  • Make it so every update reminder is once every 3 or 6 hours (Major or Minor)

But

  • There is a specific thing in update check for security and/or game braking fixes (Even tho server is far less impacted than game mod by BeamNG updates breaking it)

@lionkor What do you think of this ?

Neptnium avatar May 14 '24 06:05 Neptnium

@Neptnium we could do that, yeah. However, I very much like spamming the living shit out of people so they update, because hundreds of people they still don't, even with this spam.

Pretty much all fixes we do are to game-breaking stuff, or for security, there's never a time where I make an update and then think "ah, that's not important" :D

The other half of this issue is #233 ;)

lionkor avatar May 14 '24 06:05 lionkor

For servers, every server which isn't updated, which is missing a bugfix, can quickly become a problem because everyone playing on it can be impacted by the missing update (i.e. can be impacted by a bug).

For client and game I would agree to just do the reminder every day or on startup, because idc what people do with their own game, but for servers you need to update so all players on the servers have a good time

lionkor avatar May 14 '24 06:05 lionkor

To be fair, and to conclude my rant; for security patches that are actually dangerous we take all outdated servers from the serverlist automatically anyways.

lionkor avatar May 14 '24 06:05 lionkor

Yeah I understand, and I'm like that too, IF THERE IS AN UPDATE, DOWNLOAD IT !!! Self update that you mentioned would be amazing, I personally have my servers on pterodactyl and I just need to press a button for it to update, but self update would be even better !! Maybe what you could do is like a BootStrap or something, because otherwise I don't know how a program would react if deleted ...

Neptnium avatar May 14 '24 06:05 Neptnium

@Neptnium Adding a self-update function to servers running trough ptero can be done, although not very elegant. The egg has a startup command field, you could add a curl function that goes to grab the latest beammp server. So whenever the server crashes or you (re)start it, it would download the latest binary. The same curl function that is used in the installation process could be used. The startup command is run before the actual server is started.

Im sure you could also do that in a smarter way, but i would have to poke at ptero a bit.

But thats a bit off topic, send me a DM in discord if you want to know more about custom ptero eggs

O1LER avatar May 14 '24 07:05 O1LER

@Neptnium Adding a self-update function to servers running trough ptero can be done, although not very elegant. The egg has a startup command field, you could add a curl function that goes to grab the latest beammp server. So whenever the server crashes or you (re)start it, it would download the latest binary. The same curl function that is used in the installation process could be used. The startup command is run before the actual server is started.

Im sure you could also do that in a smarter way, but i would have to poke at ptero a bit.

But thats a bit off topic, send me a DM in discord if you want to know more about custom ptero eggs

Thx @O1LER, I already know it don't worry, but thx annyways. I don't add it since sometimes i like to have a custom version and it would f* it up. But In my install script I have also download for mods and for a library that I need for my next plugin, allowing me to have all of my servers at the same version.

~Plus I think reinstalling at every start is bad, if everyone did it, it might cause server to overload~ NVM, we download it from github so shoud be fine but anyways.

Neptnium avatar May 14 '24 09:05 Neptnium

@SaltySnail is doing this one

lionkor avatar May 25 '24 07:05 lionkor