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

Thread going into endless loop once the TCP connection limit is reached #58

Closed
click opened this issue May 16, 2011 · 16 comments
Closed

Comments

@click
Copy link
Contributor

click commented May 16, 2011

Follup ticket from http://code.google.com/p/trinitycore/issues/detail?id=3707

This is a different issue as described in #15, but can be the result of the fd leak.

Once the file descriptor limit for TCP connections is reached one TC thread (most likely networking) starts looping and the server becomes almost inaccessible.

Hooking up strace to the looping thread showed the following:

{{{

strace -p 28226

epoll_wait(15, {{EPOLLIN, {u32=22, u64=22}}}, 1, 0) = 1
accept(22, 0, NULL) = -1 EMFILE (Too many open files)
epoll_ctl(15, EPOLL_CTL_MOD, 22, {EPOLLIN|EPOLLONESHOT, {u32=22, u64=22}}) = 0
epoll_wait(15, {{EPOLLIN, {u32=22, u64=22}}}, 1, 0) = 1
[.. endless spam with the same lines ..]
}}}

How it should work:

Once the limit is reached TC should simply discard the incoming connection until other connections get closed and free up resources below the limit.

@click
Copy link
Contributor Author

click commented May 16, 2011

Author: marky81
I am having a lot this issue on rev: b28881f

Have a workround to fix this ? When its ocour TC is open but cant receive any new connections, i normaly restart all system :S

My ulimit -n is 65535

Tks

@click
Copy link
Contributor Author

click commented May 16, 2011

Author: fureya
Confirm.

After server get 900+ online limit is reached even if server limit in config is 3k ;/

@click
Copy link
Contributor Author

click commented May 16, 2011

Author: telsamat
i can confirm on 11080, bug still persists

@click
Copy link
Contributor Author

click commented May 16, 2011

Author: signfinder
Dear leak - this bug http://www.trinitycore.org/t/trinitycore/ticket/689 is reproduced on servers with online 20, 300 and 900 players. ulimit -n 4096 is worth. In my opinion you're wasting closed that ticket

@click
Copy link
Contributor Author

click commented May 16, 2011

Author: leak
Use strace -p PID on the thread that is consuming 100% CPU and we will know for sure.

@click
Copy link
Contributor Author

click commented May 16, 2011

Author: snajl
confirm

@click
Copy link
Contributor Author

click commented May 16, 2011

Author: leak
This issue is fully confirmed and already addressed.

@click
Copy link
Contributor Author

click commented May 16, 2011

Author: maxdestroyer
trace -p 3446
Process 3446 attached - interrupt to quit
futex(0x450079e0, FUTEX_WAIT, 3574, NULL
seems like that is all

@click
Copy link
Contributor Author

click commented May 16, 2011

Author: cyrex
Confirmed:

strace -p 2561
Process 2561 attached - interrupt to quit
futex(0x7f9a59bff9d0, FUTEX_WAIT, 2588, NULL

@click
Copy link
Contributor Author

click commented May 16, 2011

Author: marky81
Yes really, any workaround ? Like a bash to check this and close tc2 ? this freeze is bad =/

@click
Copy link
Contributor Author

click commented May 16, 2011

Author: telsamat
https://bitbucket.org/zippo/trinity_namiko/changeset/d0e207ac1587 i dont know it exactly but does it solve this problem?

@click
Copy link
Contributor Author

click commented May 16, 2011

Author: derex
I have fix that is supposed to work on linux/unix -> https://github.com/derex/trinitycore/tree/handle_maxfd

I am now working also on working on windows version, because on windows the problem is actually caused by other stuff.

@click
Copy link
Contributor Author

click commented May 16, 2011

Author: telsamat
thanks for that

@click click reopened this Jun 23, 2011
@click
Copy link
Contributor Author

click commented Jun 23, 2011

This issue is not completely closed, as it lacks some Windows-specific parts - do NOT close untill that is resolved.

@Voidx
Copy link

Voidx commented Jun 13, 2012

close?

@leak
Copy link
Contributor

leak commented Jul 18, 2014

It took only 4 years and the removal of ACE to fix this issue.

@leak leak closed this as completed Jul 18, 2014
MysterioPRM pushed a commit to MysterioPRM/TrinityCore that referenced this issue Mar 15, 2021
freadblangks referenced this issue in freadblangks/Aquayoup-SL Jan 15, 2022
update 07.22.21 - Fix SpellAuras and etc...
sveN295 pushed a commit to sveN295/TrinityCore that referenced this issue May 3, 2022
leelf00 pushed a commit to leelf00/TrinityCore that referenced this issue Oct 25, 2023
zTerragor pushed a commit to NeverlandWOW/NVN_DF that referenced this issue Jan 7, 2024
Core/Scripts: Add ZoneScript hook for AreaTrigger creation/deletion (…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants