-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Server: Upgrade Netty to version 4.1 #114
Conversation
Looks like CI is failing because it can't log in to DockerHub. |
Rebased, now CI failed with I think #98 looks good and has some nice ideas but there's not much to adapt -- it's a complete rewrite of the client and server whereas this is just a port to a newer version with no functional changes. Maybe in the future I'll try to implement some of the features from there. |
@StenAL I already expected the docker image name to cause problems when running on forks. Let’s see if it still works after this is merged. |
Agreed, this is good to merge with just this change.
I would actually extract the CI change out of this PR. I think we can remove building image on PR and only build on push to master, building with maven should be sufficient for PRs |
I don't quite agree. When I did the upgrade to Java 17, I broke the docker build because I forgot to change the base image. It's nice to build the image on PRs to find out breakages like this, without the step it would only be visible after merging. But I don't feel strongly about this so it's up to you to decide, I can drop the commit if you want to. |
Fair enough, how do you feel about separating the jobs for PR and merge and only doing local build without any push or login or anything. EDIT: my biggest problem is that step for PR and for push is inherently different and I dislike using ifs and other hacky solution, I would rather see it separated |
I like pushing it to :latest on every commit because, well, we do not do releases often, this way there is always a new docker image to use if you want latest & greatest |
The final release of the Netty 3.x line was in 2016 and ever since, it has been EOL (https://netty.io/news/2016/06/29/3-10-6-Final.html). Nowadays it has multiple unpatched security issues. This patch migrates the server to the latest Netty release. 4.1.112. The 4.0 branch is skipped since it is also EOL since 2018. There are a bunch of breaking changes between the versions: - Channel attachments were removed in favor of attributes, so now ClientState and Player objects are stored as attributes - `flush` needs to be called to actually send messages to clients so all calls to `write` are replaced with `writeAndFlush`. In theory this can be optimized to buffer multiple writes but since the server is not performance critical, I opted to keep it simple and always flush writes. - All Netty imports had their package changed from org.jboss to io.netty - ChannelBuffer was renamed to ByteBuf - A bunch of handler methods were renamed (e.g. channelConnected -> channelActive, messageReceived -> channelRead, channelClosed -> channelInactive) - IdleStateAwareChannelHandler was removed and now idle events are be processed by `userEventTriggered`. `getLastActivityTimeMillis` was also removed from idle events, so I reimplemented that functionality in ClientState. - OneToOneDecoder and OneToOneEncoder were replaced with more strongly typed classes, ByteToMessageDecoder and MessageToByteEncoder. They no longer return values, instead they add to the output list passed in as a parameter. - The ServerBootstrap API was redesigned to use a fluent API and a ChannelInitializer instead of a pipeline factory. The new API is mostly compatible with the old one though.
I don't feel too strongly but I agree with @pehala, since releases don't happen too often, pushing every commit to I've just rebased the branch and now it's ready for review. Also, I guess after merging this maybe you should cut a manual release? The last one was 3 years ago and there's been lots of improvements since then. |
@StenAL New release is published: https://github.com/PhilippvK/playforia-minigolf/releases/tag/v2.2.0.0-BETA Thank you for all your commits! |
The final release of the Netty 3.x line was in 2016 and ever since, it has been EOL (https://netty.io/news/2016/06/29/3-10-6-Final.html). Nowadays it has multiple unpatched security issues. This patch migrates the server to the latest Netty release. 4.1.112. The 4.0 branch is skipped since it is also EOL since 2018.
There are a bunch of breaking changes between the versions:
flush
needs to be called to actually send messages to clients so all calls towrite
are replaced withwriteAndFlush
. In theory this can be optimized to buffer multiple writes but since the server is not performance critical, I opted to keep it simple and always flush writes.userEventTriggered
.getLastActivityTimeMillis
was also removed from idle events, so I reimplemented that functionality in ClientState.