-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix configuration issue check for decoder protocol #3764
base: master
Are you sure you want to change the base?
Conversation
This does not seem right - can you explain why the issue arises and this fixes it? |
i am not really sure it arises if you switch servers quickly i looked at it again and i debugged the encoder and decoder protocols we are currently always have the encoder protocol set to GAME if the part of the code is called and the decoder protocol is GAME if it works and config if it does not so i think we dont need to check if the encoder protocol is not config, we need to check if the decoder protocol is. |
I tested this and it works for me like this without any issues |
@BoomEaro is there a reason you added the check for the encoder protocol? |
explain why the issue arises pls, outfluencer. Is there a particular reason why you cancel the . What I have to say for this from a purely I-watched-at-the-code standpoint: What is happening which causes, the configuration restarting before As there seem to be seemingly interweaving connection changes somehow, I do not get how skipping configuration starts could keep connections working correctly. If we are inside configuration mode already, we cannot simply decide now to connect to another server - we need to restart the configuration phase for the new server (according to wiki.vg it seems we have to at least watch whether "clientbound known packs" has been sent already and send it if its not sent already so we can finish config phase and start configuration phase again). As far as I see, current bungee also does not attempt to reset configuration state - it expects configuration state to either not really start at all (i.e. no connection to target server), or finish through or hope that it all goes well when target server changes, not just because multiple connection attempts are made at the same time, but also when a kick happens. And the code for handling connection loss in My final list for 1.20.2+ clients:
. |
I think the main issues is how UpstreamBridge#FinishConfiguration is handled. I think there can be multiple race conditions in how bungee handles server switching and configure states. In older version server switching was very simple, wait for In new versions it very different, and too many edge cases when something can go wrong, because you need to wait for client responses, to continue server switching procedure. CEP = Bungee->Client encode protocol
Final event order is As you can see there is too many places when edge case race condition can happen. For example, what it we start to connect to a new server when we are waiting for What if we recieve What if we recieve |
With this pr we keep track of the configuration state as we get wrong results in the server connector if we dont.
i tried to run the code that is causing the issue in the connecting players eventloop but this did not fixed the issue so i used AtomicOperations and it worked
This is the error that occours without the fix
My testplugin to replicate the race condition
You need 2 backends names lobby and lobby2