Bimde / Blackjack-Server

MIT License
0 stars 1 forks source link

I don't know what happened #35

Closed ecnivo closed 8 years ago

ecnivo commented 8 years ago

image I don't know what happened, but you should probably know about this in some way, shape, or form.

pcjl commented 8 years ago

Pretty sure this is a problem with your client, we're sending the correct message ($ 1 bets 10).

Bimde commented 8 years ago

If the server is crashing / throwing exceptions, regardless of what the clients are doing, this might be an actual bug. This will be investigated + fixed tonight.

Bimde commented 8 years ago

This looks like the message queue is trying to remove a message when there are no messages left. This is potentially due to synchronization issues (with messages being added + removed at the same time from different threads)

xuwilliam01 commented 8 years ago

Just add an if statement with queue.size. it should fix it. This wont fix the problem if some messages arent being queued at all. On Dec 8, 2015 1:50 PM, "Bimesh De Silva" notifications@github.com wrote:

This looks like the message queue is trying to remove a message when there are no messages left. This is potentially due to synchronization issues (with messages being added + removed at the same time from different threads)

— Reply to this email directly or view it on GitHub https://github.com/Bimde/Blackjack-Server/issues/35#issuecomment-162978727 .

pcjl commented 8 years ago

Whoops, I misread this. Thought this was the console output of a client rather than a server.

Bimde commented 8 years ago

@Williamxu98 This is already being done (look at the Server#actionPerformed method). The problem is probably related to the message queue being changed in between the check and removing the message from the queue. A potential solution is to use a different data structure that is thread safe. I.e. a LinkedBlockingDeque

Bimde commented 8 years ago

@ecnivo Was this using the latest version (after our discussion about using master)? And is it possible to reproduce this error?

xuwilliam01 commented 8 years ago

He was using an outdated version when he showed me the error. Try reproducing it in the new version On Dec 8, 2015 2:10 PM, "Bimesh De Silva" notifications@github.com wrote:

@ecnivo https://github.com/ecnivo Was this using the latest version (after our discussion about using master)? And is it possible to reproduce this error?

— Reply to this email directly or view it on GitHub https://github.com/Bimde/Blackjack-Server/issues/35#issuecomment-162984874 .

ecnivo commented 8 years ago

I pulled master during fifth and it was broken af, but I'm on stable at home (latest), and I haven't seen anything weird.

pcjl commented 8 years ago

Could you send logs of what is broken with master?

ecnivo commented 8 years ago

Nothing. I pressed "run" and nothing was printed, and it just stopped running. Now it's fine.

ecnivo commented 8 years ago

Silly me, I didn't realize that you guys had more game rooms and ran Server instead of CentralServer.