<div dir="ltr">An updated PR might be found here: <a href="https://github.com/infinispan/infinispan/pull/6133">https://github.com/infinispan/infinispan/pull/6133</a></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Dec 10, 2018 at 3:27 PM Sebastian Laskawiec &lt;<a href="mailto:slaskawi@redhat.com">slaskawi@redhat.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hey guys,<div><br></div><div>During Infinispan F2F, I had a short discussion with Tristan on Single Port client-side implementation. Back then, we agreed that the client should always send a Hotrod Ping request and if won&#39;t get any response (or get some HTTP content back), it will try to upgrade to the Hotrod protocol using Single Port.</div><div><br></div><div>I&#39;ve been playing with the implementation for a while, and implementing it this way seems a bit &quot;inconvenient&quot; to me. The Ping Operation uses 60s timeout, which seems to be a good fit as a default. Unfortunately, for the Single Port functionality, this means we&#39;d need to wait 60s until we try to send HTTP request and do an upgrade. Also, another problematic part is in Netty&#39;s HTTP handlers (HttpObjectDecoder, HttpServerCodec and ByteToMessageDecoder). When those classes fail to decode a message (REST expects HTTP rather than a stream of bytes specific to Hotrod protocol), they just ignore it and keep the channel in active state (which also makes sense for HTTP/1.1 and HTTP/2).</div><div><br></div><div>At this point, my intuition tells, that this doesn&#39;t look right and seems to be a over-complicated. The whole HTTP upgrade idea seems to work the other way around, use HTTP as a fallback and then upgrade to other protocols. Forcing it to work a bit differently requires some more effort.</div><div><br></div><div>What if we preserved the Single Port setting in the client configuration but implemented it as an enum with the following values - true/false/auto. In automatic mode, the client would check if the server port is set to 8\d{1,3} (this covers 80, 8080, 8081, 8443 and friends). If that is true, we&#39;d try to follow HTTP Upgrade procedure. This looks very simple and I think this might actually work. Please note, that we need the single port setting in the client configuration to cover some corner cases like the Single Port exposed on different port (like 4444) or Hot Rod exposed on port that starts with 8.</div><div><br></div><div>What do you think about such simplification? </div><div><br></div><div>Thanks,</div><div>Sebastian</div><div><br></div><div><br></div></div>
</blockquote></div>