On 18.12.20 17:43, David Osborne wrote:
When the request arrives via server1/nsssl1 on port 443 everything seems fine.

But when the requests comes in on server2/nsssl2 on port 8443, we get the error:

[18/Dec/2020:16:33:00][28278.7f80e7635700][-socks-] Error: channel "conn46" does not exist
channel "conn46" does not exist
    while executing
"ns_connchan read $from"
    (procedure "::nsf::procs::revproxy::backendReply" line 10)
    invoked from within
"::revproxy::backendReply -callback {} conn46 conn47 https://localhost:8002/proxy_test.html <https://localhost:8002/proxy_test.html> {-timeout 10.0 -sendtimeout 0.0 -receivetimeout 0.5} 0 r"
(context: connchan proc)

Adding some extra logging, the output of [ns_connchan list],  I see that the backend connchan is created under server1, where-as the frontend connchan once detached is under server2.

The problem is that all socket callbacks (from all servers) are executed in a single "socks" thread, and since different servers can have different blueprints this can also lead to troubles, when a certain callback expects different code. Actually, the lookup of connchans was always performed via a per-server hash table (i went back to 4.99.10) , so a lookup from one server (e.g. the one used in the socks thread) to connchans of different threads should not have worked in earlier versions as as well.

I have made on my instance a change to perform connchan-lookups on the default single server, which is not perfect from the scalability point of view, but passes all tests and runs already on openacs.org (4 servers in one nsd, using also revproxy). if nothing bad shows up during testing, i will commit this soon.

The probably proper solution would be to define (on or many) socks threads per server.

I am wondering, why you are using multiple servers in your setup.  If the goal is that the server should listen on multiple ports, wouldn't it be better to define for a single server multiple drivers?

all the best

-gn




_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel

Reply via email to