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

10-20 seconds of lag cause by trade #62

Closed
afoxxvi opened this issue Aug 9, 2020 · 11 comments
Closed

10-20 seconds of lag cause by trade #62

afoxxvi opened this issue Aug 9, 2020 · 11 comments

Comments

@afoxxvi
Copy link

afoxxvi commented Aug 9, 2020

This happens when two player begin to trade. And then server stopped responding for several seconds, sometimes can up to 30s.
I don't think it's tolerable, this lag totally destroyed my game experience.
I believe slow Internet caused this, because my monitor plugin warned that TradePlus is connecting Internet on server main thread. And here is console log.
https://pastebin.com/g0ET4BJn
Please fix it, thanks

@CW-UK
Copy link

CW-UK commented Aug 13, 2020

Can also confirm this issue. Massive lag spikes that drop the server to 12 TPS, when it runs at 20 consistently. Have had to rollback to 3.74

image

@leviem1
Copy link

leviem1 commented Aug 16, 2020

Seems to be correlated to #60 (at least for @CW-UK) since this is happening during the log save task from what I can tell. Though, I notice it after a trade is completed.

@afoxxvi
Copy link
Author

afoxxvi commented Aug 29, 2020

Seems to be correlated to #60 (at least for @CW-UK) since this is happening during the log save task from what I can tell. Though, I notice it after a trade is completed.

However in version 3.79.1 this problem still exists.
And the thread dump is totally same as before, caused by the plugin's network in main thread.
@Trophonix Could please have a look at this? This's really a very severe problem.

@afoxxvi
Copy link
Author

afoxxvi commented Aug 29, 2020

I guess by changing
com.trophonix.tradeplus.util.InvUtils line 59
inv.setItem( pl.getTradeConfig().getAcceptSlot(), ItemFactory.getPlayerSkull(player1, "&f" + player1.getName())); inv.setItem( pl.getTradeConfig().getTheirAcceptSlot(), ItemFactory.getPlayerSkull(player2, "&f" + player2.getName()));
to
if (pl.getTradeConfig().isHeadEnabled()){ inv.setItem( pl.getTradeConfig().getAcceptSlot(), ItemFactory.getPlayerSkull(player1, "&f" + player1.getName())); inv.setItem( pl.getTradeConfig().getTheirAcceptSlot(), ItemFactory.getPlayerSkull(player2, "&f" + player2.getName())); }
can solve it if I disable head in config.

@Nezz202
Copy link

Nezz202 commented Dec 9, 2020

Hey. Did this fix work for you? This is a real issue on my server. I'm on 3.79.5 and still getting issue frequently with the server hanging for up to 30 seconds. I'm hesitant to change this as I'm not very knowledable with code ect, and don't want to cause more issues than it fixes. Thanks 👍

@afoxxvi
Copy link
Author

afoxxvi commented Dec 22, 2020

@Nezz202
The code I given above works and solved my problem, and it's proved that the huge lag was caused by loading head textures.

@Trophonix
Please fix this problem, it can be completed easily with a little work on method com.trophonix.tradeplus.util.InvUtils.getSpectatorInventory(). Thanks!

@Spiritho15
Copy link

any recent updates regarding this issue?

@leviem1
Copy link

leviem1 commented Jul 26, 2023

@Spiritho15 I wrote a quick and dirty patch for this but it got hung up in review and I never heard from the plugin author afterwards. I ended up closing the PR due to inactivity.

@afoxxvi
Copy link
Author

afoxxvi commented Jul 29, 2023

@Spiritho15 @leviem1 Already fixed very long ago.

@leviem1
Copy link

leviem1 commented Jul 29, 2023

@Spiritho15 @leviem1 Already fixed very long ago.

Oh sweet, didn't know about that. Can you close the issue @afoxxvi?

@afoxxvi
Copy link
Author

afoxxvi commented Jul 29, 2023

I didn’t have noticed it, sorry.

@afoxxvi afoxxvi closed this as completed Jul 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants