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

Rewrite User storage and UUID cache #4581

Merged
merged 72 commits into from
Sep 4, 2022
Merged

Conversation

JRoy
Copy link
Member

@JRoy JRoy commented Oct 17, 2021

A rewrite of user loading, user caching, uuid caching, and user memory management.

Closes #4512
Closes #4342
Closes #4566
Closes #4581


Technical Breakdown of ModernUserMap + ModernUUIDCache

TODO :trollface:


Checklist;

  • Store username history more sanely
  • Rewrite the UUID cache
  • Rewrite the UserMap and replace the old UserMap
  • Add ABI backwards compatibility for certain hot methods in old UserMap

@JRoy JRoy added type: enhancement Features and feature requests. type: bugfix PRs that fix bugs in EssentialsX. module: main Issues or PRs for the main Essentials module labels Oct 17, 2021
@JRoy JRoy added this to the 2.19.1 milestone Oct 17, 2021
@JRoy JRoy mentioned this pull request Oct 17, 2021
@JRoy JRoy changed the title Rewrite UserMap Rewrite User storage and UUID cache Oct 17, 2021
@JRoy JRoy marked this pull request as ready for review October 18, 2021 03:04
@tadhgboyle
Copy link
Contributor

:shipit:

pop4959
pop4959 previously approved these changes Oct 28, 2021
Copy link
Member

@pop4959 pop4959 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

//noinspection ConstantConditions

JRoy added 12 commits July 23, 2022 19:09
# Conflicts:
#	Essentials/src/main/java/com/earth2me/essentials/commands/Commandessentials.java
Always call ModernUserMap#getUser(Player) during join to ensure the
fetched/created User object has the most up-to-date name on the underlying
Player object. Additionally, ensure that ModernUUIDCache#updateCache is always
called during #getUser and not just when we generate a new User object (which
always never happens by the time the call is made 💀).
Used to create User objects based on player objects for use from when before
Bukkit places the user into its own internal usermap.
Without this, ModernUserMap#loadUncachedUser(UUID) would attempt to fetch
the player from the server only to not return null because we first try to
create a user during PlayerLoginEvent which is before Bukkit puts the player
into its internal usermap.
Copy link
Member

@mdcfe mdcfe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Side note: do we want an API interface for ModernUserMap? Just so there's an explicit (and limited) set of methods that plugins should expect to use, otherwise I anticipate people will just call internal methods

@JRoy JRoy requested a review from mdcfe August 25, 2022 21:42
.idea/checkstyle-idea.xml Outdated Show resolved Hide resolved
@mdcfe mdcfe changed the base branch from 2.x to dev/2.20 August 31, 2022 14:29
@JRoy JRoy requested a review from mdcfe August 31, 2022 22:41
@mdcfe mdcfe merged commit be91573 into dev/2.20 Sep 4, 2022
@mdcfe mdcfe deleted the refactor/usermap-rewrite branch September 4, 2022 14:42
JRoy added a commit that referenced this pull request Sep 4, 2022
Co-authored-by: triagonal <10545540+triagonal@users.noreply.github.com>
Co-authored-by: MD <1917406+mdcfe@users.noreply.github.com>
JRoy added a commit that referenced this pull request Sep 9, 2022
Co-authored-by: triagonal <10545540+triagonal@users.noreply.github.com>
Co-authored-by: MD <1917406+mdcfe@users.noreply.github.com>
@mibby
Copy link

mibby commented Sep 17, 2022

@JRoy Not entirely sure where to leave feedback for this but noticed that every time Citizens loads an npc (server restarts, teleporting around), Essentials spams creating a user for them.
https://paste.gg/p/anonymous/e7fd399e9db6436d8ed3c5ee15dae70a/files/febeaa22bd6846a8aa7d8a93acb63b85/raw

EssentialsX-2.20.0-dev+5
https://ci.ender.zone/view/All/job/EssentialsX-Experimental/100007/
Citizens2 dev 2705
https://ci.citizensnpcs.co/job/Citizens2/

@JeffP07
Copy link

JeffP07 commented Sep 18, 2022

@JRoy Not entirely sure where to leave feedback for this but noticed that every time Citizens loads an npc (server restarts, teleporting around), Essentials spams creating a user for them. https://paste.gg/p/anonymous/e7fd399e9db6436d8ed3c5ee15dae70a/files/febeaa22bd6846a8aa7d8a93acb63b85/raw

EssentialsX-2.20.0-dev+5 https://ci.ender.zone/view/All/job/EssentialsX-Experimental/100007/ Citizens2 dev 2705 https://ci.citizensnpcs.co/job/Citizens2/

I had this issue and found it was caused by jail.yml having old data that was formatted in a different way than new jails. Since I don't actually use the jails, removing the file contents worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: main Issues or PRs for the main Essentials module type: bugfix PRs that fix bugs in EssentialsX. type: enhancement Features and feature requests.
Projects
None yet
9 participants