[Glass] ZnZincServerAdaptor on Gemstone

Iwan Vosloo iwan at reahl.org
Wed Jun 17 05:00:04 PDT 2020


Hello.

We're currently using WAFastCGIAdaptor in Gemstone 3.4.1. Calling start 
on it does not return and utilises the current process to serve requests.

We'd like to use ZnZincServerAdaptor in the same way, but I can't figure 
out how to do that.  (We're using v2.4.3.6 of github://GsDevKit/zinc).

What I've tried to do is to subclass from ZnSingleThreadedServer, and on 
it override start to something that does not fork:

ZnForegroundServer:

start
	self stop: false.
	self class default = self
		ifTrue: [ self register ].
	[ self listenLoop ] repeat

Then, I'd start the adaptor like this:

(ZnZincServerAdaptor port: portInteger)
		serverClass: ZnForegroundServer;
		start.

Running the above blocks and listens on the socket. But as soon as I try 
to hit it with a web browser, the browser is left waiting for a response 
while the server breaks with:

ERROR 2710 , a ConnectionClosed occurred (error 2710), , Connection 
closed while waiting for data. (ConnectionClosed)

I realise I don't understand this code at all, but I thought this ought 
to be do-able. Any advice would be appreciated!

For interest, here is the stack trace when run from topaz:

==> 1 ConnectionClosed (AbstractException) >> _signalWith: @6 line 25
2 ConnectionClosed (AbstractException) >> signal: @3 line 7
3 ConnectionClosed class (AbstractException class) >> signal: @3 line 4
4 SocketStreamSocket >> receiveDataSignallingTimeout:into:startingAt: 
@11 line 14
5 SocketStream >> receiveData                   @6 line 15
6 SocketStream >> next                          @7 line 9
7 ZnLineReader >> processNext                   @6 line 4
8 ZnLineReader >> nextLine                      @3 line 3
9 ZnRequestLine >> readFrom:                    @4 line 3
10 ZnRequestLine class >> readFrom:              @3 line 3
11 ZnRequest >> readHeaderFrom:                  @2 line 2
12 ZnRequest (ZnMessage) >> readFrom:            @2 line 2
13 ZnRequest class (ZnMessage class) >> readFrom: @3 line 3
14 [] in ZnServer >> reader                      @7 line 4
15 [] in ZnSingleThreadedServer >> readRequest:  @16 line 6
16 [] in ZnSingleThreadedServer >> withMaximumEntitySizeDo: @11 line 6
17 [] in DynamicVariable class >> value:during:  @16 line 9
18 ExecBlock0 (ExecBlock) >> ensure:             @2 line 12
19 ZnMaximumEntitySize class (DynamicVariable class) >> value:during: @7 
line 10
20 ZnForegroundServer (ZnSingleThreadedServer) >> 
withMaximumEntitySizeDo: @6 line 5
21 ZnForegroundServer (ZnSingleThreadedServer) >> readRequest: @3 line 6
22 [] in ZnSingleThreadedServer >> executeOneRequestResponseOn: @13 line 12
23 ExecBlock0 (ExecBlock) >> on:do:              @3 line 44
24 [] in ZnSingleThreadedServer >> executeOneRequestResponseOn: @9 line 16
25 [] in DynamicVariable class >> value:during:  @16 line 9
26 ExecBlock0 (ExecBlock) >> ensure:             @2 line 12
27 ZnCurrentServer class (DynamicVariable class) >> value:during: @7 line 10
28 ZnForegroundServer (ZnSingleThreadedServer) >> 
executeOneRequestResponseOn: @5 line 9
29 [] in ZnSingleThreadedServer >> serveConnectionOn: @31 line 13
30 ExecBlock0 (ExecBlock) >> on:do:              @3 line 44
31 [] in ZnSingleThreadedServer >> serveConnectionOn: @27 line 14
32 ExecBlock0 (ExecBlock) >> ensure:             @2 line 12
33 [] in ZnSingleThreadedServer >> serveConnectionOn: @21 line 16
34 [] in ExecBlock >> ifCurtailed:               @8 line 6
35 ExecBlock0 (ExecBlock) >> ensure:             @2 line 12
36 ExecBlock0 (ExecBlock) >> ifCurtailed:        @4 line 8
37 [] in ZnSingleThreadedServer >> serveConnectionOn: @17 line 19
38 ExecBlock0 (ExecBlock) >> on:do:              @3 line 44
39 ZnForegroundServer (ZnSingleThreadedServer) >> serveConnectionOn: @5 
line 22
40 [] in ZnSingleThreadedServer >> listenLoop    @12 line 12
41 [] in ExecBlock >> ifCurtailed:               @8 line 6
42 ExecBlock0 (ExecBlock) >> ensure:             @2 line 12
43 ExecBlock0 (ExecBlock) >> ifCurtailed:        @4 line 8
44 ZnForegroundServer (ZnSingleThreadedServer) >> listenLoop @4 line 14
45 ZnForegroundServer >> start                   @8 line 5
46 ZnZincServerAdaptor >> basicStart             @3 line 2
47 [] in WAServerManager >> start:               @9 line 3
48 [] in ExecBlock >> ifCurtailed:               @8 line 6
49 ExecBlock0 (ExecBlock) >> ensure:             @2 line 12
50 ExecBlock0 (ExecBlock) >> ifCurtailed:        @4 line 8
51 WAServerManager >> start:                     @5 line 4
52 ZnZincServerAdaptor (WAServerAdaptor) >> start @3 line 2




-- 




More information about the Glass mailing list