Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Critical Bug with List-Variables #2022

Closed
Duetro opened this issue Apr 24, 2019 · 9 comments
Closed

Critical Bug with List-Variables #2022

Duetro opened this issue Apr 24, 2019 · 9 comments
Labels
cannot reproduce An issue that cannot be replicated. needs testing Needs testing to determine current status or issue validity, or for WIP feature pulls. variables Related to variables and/or storing them.

Comments

@Duetro
Copy link

Duetro commented Apr 24, 2019

Description

Hi. We have found a huge Problem with List-Variables. Sometimes the last Variables don't get set.

Steps to Reproduce

command /duetro_vartest:
    trigger:
        loop 10 times:
            delete {-bugtest::*}
            wait 0.5 seconds
            loop 1000 times:   
                add true to {-bugtest::*}
                chance of 1%
                wait a tick
            send "Size: %size of {-bugtest::*}%"   
            wait 0.5 seconds

Example Output: https://s.duetro.de/i/javaw_2019-04-24_15-24-44.png
Note: More Variables are missing if there is a wait in between the adds!

Server Information

  • Server version/platform: git-Paper-1606 (MC: 1.12.2)
  • Skript version: 2.3.6

Plugins

Plugins (46): ArmorStandEditor, BannerMaker, BKCommonLib, BuycraftX, Citizens, CrackShot, CrackShotPlus, CS-CoreLib, Essentials, EssentialsProtect, ForceResourcepacks, GMDE-Skript-AddOn, HeadDatabase, HolographicDisplays, LagMonitor, LightAPI, LightCleaner, LuckPerms, Magic, Multiverse-Core, MundoSK, NametagEdit, NoCheatPlus, Orebfuscator4, PacketWrapper, PlaceholderAPI, PremiumVanish, ProtocolLib, SK-NBeeT, skDragon, Skellett, SkQuery, skRayFall, Skript, skript-mirror, skUtilities, SQLibrary, TuSKe, UltraCosmetics, Vault, Votifier, WebAddon, WolvSK, WorldBorder, WorldEdit, WorldGuard
@TheBentoBox
Copy link
Member

What variable storage method do you use? CSV or a database?

I'd like to note that @Blueyescat has tested this and cannot reproduce, and even if we do find a way to reproduce it this "critical bug" is potentially just due to you trying to access variables which haven't fully been written to your database yet. You're creating a LOT of variables very fast here then accessing them immediately -- generally there is no reason to do this.

@Blueyescat
Copy link
Contributor

> test
[16:45:12 WARN]: [Skript] Cannot write variables to the database 'default' at sufficient speed; server performance may suffer and many variables will be lost if the server crashes. (this warning will be repeated at most once every 10 seconds)
[16:45:13 INFO]: Size: 1000
[16:45:15 INFO]: Size: 1000
[16:45:16 INFO]: Size: 1000
[16:45:18 INFO]: Size: 1000
[16:45:19 INFO]: Size: 1000
[16:45:21 INFO]: Size: 1000
[16:45:22 INFO]: Size: 1000
[16:45:22 WARN]: [Skript] Cannot write variables to the database 'default' at sufficient speed; server performance may suffer and many variables will be lost if the server crashes. (this warning will be repeated at most once every 10 seconds)
[16:45:24 INFO]: Size: 1000
[16:45:25 INFO]: Size: 1000
[16:45:26 INFO]: Size: 1000

@Duetro
Copy link
Author

Duetro commented Apr 24, 2019

Hi, this happens when we save to MySQL or just to RAM (With the - prefix).
The Variables are still missing if we wait for one second and then check the size again

[15:51:56 INFO]: 1-OK: 1000
[15:51:57 INFO]: 2-OK: 1000
[15:51:57 INFO]: 1-OK: 1000
[15:51:58 INFO]: 2-OK: 1000
[15:51:59 INFO]: 1-OK: 1000
[15:52:00 INFO]: 2-OK: 1000
[15:52:00 INFO]: 1-Variables Missing! >> Size: 998
[15:52:01 INFO]: 2-Variables Missing! >> Size: 998
[15:52:02 INFO]: 1-OK: 1000
[15:52:03 INFO]: 2-OK: 1000
[15:52:04 INFO]: 1-OK: 1000
[15:52:05 INFO]: 2-OK: 1000
[15:52:06 INFO]: 1-OK: 1000
[15:52:07 INFO]: 2-OK: 1000
[15:52:07 INFO]: 1-OK: 1000
[15:52:08 INFO]: 2-OK: 1000
[15:52:09 INFO]: 1-OK: 1000
[15:52:10 INFO]: 2-OK: 1000
[15:52:10 INFO]: 1-OK: 1000
[15:52:11 INFO]: 2-OK: 1000

@Duetro
Copy link
Author

Duetro commented Apr 24, 2019

On the main server (currently ~90 players) this happens even more often:
https://s.duetro.de/i/javaw_2019-04-24_16-03-31.png

@Blueyescat
Copy link
Contributor

Blueyescat commented Apr 24, 2019

So it might be some issue depending on the server resources. I'm trying with 90 ticks delay... (It will take a long time lol)

I did the non-saved variables thing but still i get Cannot write variables warnings, but yeah they aren't saved.

command /test:
	trigger:
		send "&aStart"
		loop 10 times:
			delete {-bugtest::*}
			wait 0.5 seconds
			loop 1000 times:   
				add true to {-bugtest::*}
				chance of 1%
				wait 90 ticks
			send "Size: %size of {-bugtest::*}%"   
			wait 0.5 seconds
		send "&cFinish"
> test
[17:08:18 INFO]: Start
[17:08:18 WARN]: [Skript] Cannot write variables...
[17:09:04 INFO]: Size: 1000
[17:09:05 WARN]: [Skript] Cannot write variables...
[17:10:04 INFO]: Size: 1000
[17:10:04 WARN]: [Skript] Cannot write variables...
[17:10:32 INFO]: Size: 1000
[17:10:32 WARN]: [Skript] Cannot write variables...
[17:11:27 INFO]: Size: 1000
[17:11:28 WARN]: [Skript] Cannot write variables...
[17:12:32 INFO]: Size: 1000
[17:12:32 WARN]: [Skript] Cannot write variables...
[17:13:18 INFO]: Size: 1000
[17:13:18 WARN]: [Skript] Cannot write variables...
[17:14:13 INFO]: Size: 1000
[17:14:14 WARN]: [Skript] Cannot write variables...
[17:15:04 INFO]: Size: 1000
[17:15:04 WARN]: [Skript] Cannot write variables...
[17:16:04 INFO]: Size: 1000
[17:16:04 WARN]: [Skript] Cannot write variables...
[17:16:37 INFO]: Size: 1000
[17:16:37 INFO]: Finish

@bensku
Copy link
Member

bensku commented Apr 29, 2019

This could be a serious bug in MySQL variable storage. Unfortunately it has not exactly been maintained for a long time - there is no one who really knows how to work with it anymore.

@bensku bensku added the variables Related to variables and/or storing them. label Apr 29, 2019
@Blueyescat
Copy link
Contributor

@Duetro tried without saving to somewhere or saving to MySQL as he said above, and i tried with saving to CSV or without saving but couldn't reproduce. I think it might be related to RAM... investigating label would be good.

@Whimsyturtle Whimsyturtle added the needs testing Needs testing to determine current status or issue validity, or for WIP feature pulls. label Oct 17, 2019
@TPGamesNL
Copy link
Member

This might've been caused by scripts running on other threads, because Skript's variable system doesn't support multiple threads using it

@TheLimeGlass TheLimeGlass added the cannot reproduce An issue that cannot be replicated. label May 5, 2023
@Moderocky
Copy link
Member

I'm closing this since nobody else has reported the issue since and nobody has been able to reproduce it, so triage would be impossible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cannot reproduce An issue that cannot be replicated. needs testing Needs testing to determine current status or issue validity, or for WIP feature pulls. variables Related to variables and/or storing them.
Projects
None yet
Development

No branches or pull requests

8 participants