Closed marcsello closed 5 years ago
Okay, it seems like, that the issue is not caused by the java exception, more likely the fact, that this exception is repeated over and over for at least 650.000.000 lines (not kidding!) I think that caused some overflow, or deadlock.
It seems like, some sort of exception is happened there. I've dug up the logs from that day, and found this stacktrace:
Dec 23 22:52:06 celestia minecraftd[27025]: 2018-12-23 22:52:06,336 - INFO: Minecraftd is starting...
Dec 23 22:52:07 celestia minecraftd[27025]: 2018-12-23 22:52:07,213 - INFO: New client connected!
Jan 19 21:40:11 celestia minecraftd[27025]: Traceback (most recent call last):
Jan 19 21:40:11 celestia minecraftd[27025]: File "/usr/local/bin/minecraftd", line 11, in <module>
Jan 19 21:40:11 celestia minecraftd[27025]: load_entry_point('minecraftd', 'console_scripts', 'minecraftd')()
Jan 19 21:40:11 celestia minecraftd[27025]: File "/home/marcsello/minecraftd/minecraftd/__main__.py", line 96, in main
Jan 19 21:40:11 celestia minecraftd[27025]: rc = runDaemon(cfg)
Jan 19 21:40:11 celestia minecraftd[27025]: File "/home/marcsello/minecraftd/minecraftd/__main__.py", line 42, in runDaemon
Jan 19 21:40:11 celestia minecraftd[27025]: lp.passLine(l.decode('utf-8')) # line processor expects strings
Jan 19 21:40:11 celestia minecraftd[27025]: File "/home/marcsello/minecraftd/minecraftd/lineprocessor.py", line 44, in passLine
Jan 19 21:40:11 celestia minecraftd[27025]: self._clientSwapper.sendLine(line) # expects utf-8 string
Jan 19 21:40:11 celestia minecraftd[27025]: File "/home/marcsello/minecraftd/minecraftd/clientswapper.py", line 54, in sendLine
Jan 19 21:40:11 celestia minecraftd[27025]: self._sendDataToClient(line)
Jan 19 21:40:11 celestia minecraftd[27025]: File "/home/marcsello/minecraftd/minecraftd/clientswapper.py", line 41, in _sendDataToClient
Jan 19 21:40:11 celestia minecraftd[27025]: self._client.sendLine(data)
Jan 19 21:40:11 celestia minecraftd[27025]: File "/home/marcsello/minecraftd/minecraftd/client.py", line 33, in sendLine
Jan 19 21:40:11 celestia minecraftd[27025]: self.sock.sendall(line.encode('utf-8'))
Jan 19 21:40:11 celestia minecraftd[27025]: BlockingIOError: [Errno 11] Resource temporarily unavailable
Jan 19 21:40:11 celestia minecraftd[27025]: 2019-01-19 21:40:11,904 - INFO: New client connected!
Jan 19 21:40:11 celestia minecraftd[27025]: 2019-01-19 21:40:11,904 - INFO: Previous session terminated
Jan 19 21:40:30 celestia minecraftd[27025]: 2019-01-19 21:40:30,128 - INFO: Client disconnected
Jan 19 21:40:31 celestia minecraftd[27025]: 2019-01-19 21:40:31,495 - INFO: New client connected!
Jan 19 21:40:33 celestia minecraftd[27025]: 2019-01-19 21:40:33,540 - INFO: Client disconnected
Jan 19 21:41:23 celestia minecraftd[27025]: 2019-01-19 21:41:23,081 - INFO: New client connected!
Jan 19 21:46:11 celestia minecraftd[27025]: 2019-01-19 21:46:11,075 - INFO: Client disconnected
Jan 19 21:46:12 celestia minecraftd[27025]: 2019-01-19 21:46:12,100 - INFO: New client connected!
Jan 19 21:46:20 celestia minecraftd[27025]: 2019-01-19 21:46:20,975 - INFO: Client disconnected
I've also created a simple java program that spams this error, to help me debug. With that I was able to produce the following crash:
2019-02-17 02:42:26,746 - INFO: Minecraftd is starting...
2019-02-17 02:42:31,512 - INFO: New client connected!
Traceback (most recent call last):
File "/usr/lib/python3.5/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/marcsello/minecraftd/minecraftd/__main__.py", line 112, in <module>
main()
File "/home/marcsello/minecraftd/minecraftd/__main__.py", line 103, in main
rc = runDaemon(cfg)
File "/home/marcsello/minecraftd/minecraftd/__main__.py", line 43, in runDaemon
lp.passLine(l.decode('utf-8')) # line processor expects strings
File "/home/marcsello/minecraftd/minecraftd/lineprocessor.py", line 45, in passLine
self._clientSwapper.sendLine(line) # expects utf-8 string
File "/home/marcsello/minecraftd/minecraftd/clientswapper.py", line 54, in sendLine
self._sendDataToClient(line)
File "/home/marcsello/minecraftd/minecraftd/clientswapper.py", line 41, in _sendDataToClient
self._client.sendLine(data)
File "/home/marcsello/minecraftd/minecraftd/client.py", line 33, in sendLine
self.sock.sendall(line.encode('utf-8'))
BlockingIOError: [Errno 11] Resource temporarily unavailable
This error happened just after attaching to the console. With the console detached, it was running fine. But I think when the crash happened, I've left the console attached in a tmux session.
It's visible on the logs however, that the last output visible on the console was around 18:32 and the exception happened at 21:40. But there is a new client message just after the exception, and the exceptions look very similar, so I still assume the crash happens when a client tries to connect.
Fixed the above exception in 7fa66b6cd61f58247111969890eee1035255db9e. It was caused by the socket's non-blocking nature.
But fixing this revealed another bug related to concurrent threads, So I've opened a new branch for console spam related issue fixing: "spam-fix".
This issue is being worked on as well.
Fixed everything in #5
Tested the concurrency issue, for about 500 random connect/disconnect. Everything was fine so I can finally close this issue.
After a Huge Java exception occured, the output of the server was not visible on the attachable console. The entered commands are received by the server however.
Example: