Skip to content

EcoProfile is read in sync #389

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

Open
JoField08 opened this issue Mar 1, 2025 · 1 comment · May be fixed by #390
Open

EcoProfile is read in sync #389

JoField08 opened this issue Mar 1, 2025 · 1 comment · May be fixed by #390
Labels
bug Something isn't working

Comments

@JoField08
Copy link

JoField08 commented Mar 1, 2025

Describe the bug
Hey, I have a problem with Eco. Since using it the server is always lagging for a brief second when a new player joins the server. This is pretty annoying for a lot of players and especially noticeable if multiple players join in a short time.

To Reproduce
Steps to reproduce the behavior:

  1. Install Eco and use one or multiple plugins using eco to access the ecoprofile (for exmaple EcoSkills or EcoEnchants) on the Server
  2. Set the storage type to mysql
  3. players must join the server
  4. experience the lag which occurs

Expected behavior
The server should not lag when players join

Screenshots
Here is a screenshot of our live server:
https://i.imgur.com/SD87IBH.png

Server Information (please complete the following information):

  • Paper: 1.21.4-187
  • eco: 6.75.2

Additional context
Here is a full spark from my test server with only me online and reconnecting. Only ticks above 50ms were recorded.
The report is a bit older, as the issue occurred before, but the issue still exists
https://spark.lucko.me/zPHeCvyBWz

I think the issue is coming from PersistentDataHandler#read() where the DB query just gets joined for whatever reason https://i.imgur.com/U2uOTgk.png

@JoField08 JoField08 added the bug Something isn't working label Mar 1, 2025
@twisti-dev
Copy link

We've been experiencing this issue for several months now, and it's becoming increasingly frustrating. Despite reporting it, we haven't received any response or acknowledgment from the support team. The lag when players join is a serious problem, especially on larger servers, and it would be great to know if this is even being looked into. Any update or feedback would be much appreciated.

MillionthOdin16 added a commit to MillionthOdin16/eco that referenced this issue Mar 5, 2025
Fixes Auxilor#389

Update the `read` method in `PersistentDataHandler` to use `CompletableFuture` for asynchronous operations.

* Change the `read` method in `PersistentDataHandler.java` to return `CompletableFuture<T>` instead of `T`.
* Remove the blocking call `future.get()` from the `read` method.
* Update the `read` method in `EcoProfile.kt` to handle the new `CompletableFuture` return type.
* Use `thenApply` to process the result of the `CompletableFuture` in the `read` method in `EcoProfile.kt`.
* Ensure the `read` method in `EcoProfile.kt` returns the default value if the `CompletableFuture` is null.
@MillionthOdin16 MillionthOdin16 linked a pull request Mar 5, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants