Giter VIP home page Giter VIP logo

zinc's Introduction

GsDevKitBuild Status

Work in Progress eventual replacement for glassdb/glass project

Installation

Gofer new
  package: 'GsUpgrader-Core';
  repository: (MCGitHubRepository location: 'github://GsDevKit/gsUpgrader:dev/repository');
  load.
(Smalltalk at: #GsUpgrader) upgradeGsDevKit.

zinc's People

Contributors

dalehenrich avatar dassi avatar hese avatar jbrichau avatar nickager avatar pdebruic avatar svenvc avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zinc's Issues

merge Svens latest work

Once Sven updates the master pharo repo merge his changes into Gemstone2.4 branch.

Has the Gemstone3.1 branch diverged form the Gemstone2.4 branch yet?

10 MByte socket problem

Marten reports:

10 MByte Socket problem - this is a limitation within Gemstone and the
reading service method within Zinc should consider this ...

Implement Gzip* GIF* PNG* and JPEG* readers and writers in GemStone 3.1

In GemStone 3.1 we have PortableStreams that are very compatible with the Pharo Streams, thus making it much easier to port these streams to GemStone ....

The porting task is much more difficult for GemStone2.4...

Along these lines I would be inclined to delete these classes on the gemstone2.4 branch (leaving them on the gemstone3.1 branch)

Port GZipReadStream & GZipWriteStream from Pharo

Used in:

ZnEntityReader->'readEntityFromStream',
ZnChunkedReadStreamTests->'testReadingGzip',
ZnChunkedReadStreamTests->'testReadingGzipStepped'
ZnChunkedReadStreamTests->'testReadingGzip',
ZnChunkedReadStreamTests->'testReadingGzipStepped'

review server stack for GemStone/Seaside

The server stack starts with a fork in ZnSingleThreadedServer>>start, then ZnSingleThreadedServer>>listenLoop initiates an infinite loop for serving requests calling ZnSingleThreadedServer>>serveConnectionOn: which forks off a separate thread to serve each request.

Presumably the Seaside is adaptor is called during the request handling ... where the transaction boundaries are managed.

There are basically four issues to consider:

  1. Need to make sure that there is no persistent state being modified in the server stack above the Seaside transaction boundaries.
  2. Install error handlers so that server errors can be logged and threads cleanly shutdown. Any unhandled errors in the server stack will terminate the gems.
  3. Make ZnSingleThreadedServer>>start a blocking call. We want the server to be block so the outmost fork in ZnSingleThreadedServer>>start is unnecessary ... the repeat block in ZnSingleThreadedServer>>listenLoop is an effective blocking scheme.
  4. With FastCGI, we discovered that at high request rates we could blow out memory with unrestricted accept/forks, so we need to probably introduce a limiter of some sort there.

Under load testing we should be able to flush out any other issues.

NeoJSON loads from master and not from gs_master ?

Why is NeoJSON referenced via "github://GsDevKit/NeoJSON:master/repository" and not via the published "github://GsDevKit/NeoJSON:gs_master/repository" ? All the newly Unicode stuff is then missing ...

Marten

Timeout passed to a ZnClient is ignored while making the connection via the underlying socket

Suppose the following situation:

  • Create a ZnClient
  • Pass in an explicit timeout (e.g., 3 seconds)
  • Pass in a host/port combination that does not exist

Expected behavior: an error should be thrown after 3 seconds.

What happens: the user has to wait for the (default) timeout of GsSocket; the timeout passed in to the client is ignored.

Reason: the SocketStream does not use the timeout while connecting to the socket created via SocketStreamSocket.

In the code this is reflected in the following extension method

SocketStream>>openConnectionToHost: host port: portNumber timeout: timeout
| socket |
socket :=SocketStreamSocket newTCPSocket.
socket connectTo: host port: portNumber.
^(self on: socket) 
    timeout: timeout; 
    yourself

I compared this with the Pharo implementation, and here the timeout is passed.

GemStone2.4.x ... ZnGsServerTests>>#testError failing

Creating the continuation to record the error fails, because the Process scheduler cannot be persisted:

topaz 1> topaz 1> ZnServerBasedTestServer Server started on port 1709
--transcript--'Starting server: aZnTransactionSafeManagingMultiThreadedServer(stopped 1709) (native thread: false)'
------INTERNAL ZINC ERROR: 10:16:45------
InterpreterError 2407: The object <aProcessorScheduler> may not be committed, instances of its class are non-persistent.
1 ComplexBlock in ZnSingleThreadedServer >> handleError: @15 line 13  [GsMethod OOP 239300865]
2 ExceptionHandler >> doTryBlock: @9 line 7  [GsMethod OOP 11842305]
3 ExceptionHandler >> try:on:do: @15 line 21  [GsMethod OOP 11842817]
4 ComplexBlock in ExecutableBlock >> on:do: @2 line 9  [GsMethod OOP 9571329]
5 ZnSingleThreadedServer >> handleError: @24 line 16  [GsMethod OOP 239300865]
6 ZnSingleThreadedServer >> logServerError: @4 line 6  [GsMethod OOP 192040193]
7 ComplexBlock in ZnTransactionSafeManagingMultiThreadedServer >> serveConnectionsOn: @27 line 22  [GsMethod OOP 240563969]
8 ExceptionHandler >> caughtExceptionWithAction: @5 line 4  [GsMethod OOP 11842049]
9 ComplexBlock in ExceptionHandler >> caughtEx:number:cat:args:handler: @12 line 13  [GsMethod OOP 11841537]
10 ComplexBlock in ExecutableBlock >> ensure: @4 line 11  [GsMethod OOP 2337281]
11 ComplexBlock in ExecutableBlock >> ensure: @6 line 11  [GsMethod OOP 2337281]
12 ExceptionHandler >> caughtEx:number:cat:args:handler: @16 line 14  [GsMethod OOP 11841537]
13 ComplexBlock in ExceptionHandler >> try:on:do: @10 line 15  [GsMethod OOP 11842817]
14 Exception >> _signal:number:args: @2 line 7  [GsMethod OOP 2365953]
15 ExceptionHandler >> outer @8 line 8  [GsMethod OOP 11839489]
16 ExceptionA >> pass @2 line 11  [GsMethod OOP 11835905]
17 ComplexBlock in ZnTransactionSafeManagingMultiThreadedServer >> executeOneRequestResponseOn: @19 line 20  [GsMethod OOP 240564737]
18 ExceptionHandler >> caughtExceptionWithAction: @5 line 4  [GsMethod OOP 11842049]
19 ComplexBlock in ExceptionHandler >> caughtEx:number:cat:args:handler: @12 line 13  [GsMethod OOP 11841537]
20 ComplexBlock in ExecutableBlock >> ensure: @4 line 11  [GsMethod OOP 2337281]
21 ComplexBlock in ExecutableBlock >> ensure: @6 line 11  [GsMethod OOP 2337281]
22 ExceptionHandler >> caughtEx:number:cat:args:handler: @16 line 14  [GsMethod OOP 11841537]
23 ComplexBlock in ExceptionHandler >> try:on:do: @10 line 15  [GsMethod OOP 11842817]
24 Object >> _gsReturnTos @1 line 1  [GsMethod OOP 1890049]
25 System class >> __commit: @1 line 8  [GsMethod OOP 1690881]
26 System class >> _localCommit: @8 line 30  [GsMethod OOP 1691393]
27 TransactionBoundaryDefaultPolicy >> commit: @2 line 3  [GsMethod OOP 8119041]
28 System class >> _commit: @6 line 16  [GsMethod OOP 1691649]
29 System class >> commitTransaction @2 line 28  [GsMethod OOP 1697793]
30 System class >> _commitPrintingDiagnostics @2 line 9  [GsMethod OOP 1620481]
31 SystemCommitTransaction >> defaultAction @1 line 3  [GsMethod OOP 55129601]
32 ExceptionA >> _defaultAction @1 line 4  [GsMethod OOP 11833601]
33 ExceptionA >> signal @7 line 37  [GsMethod OOP 11828737]
34 ExceptionA >> signal: @3 line 12  [GsMethod OOP 11828993]
35 ExceptionA class >> signal: @2 line 3  [GsMethod OOP 13016833]
36 ExceptionA class >> signal @2 line 9  [GsMethod OOP 13012737]
37 GRGemStonePlatform >> doCommitTransaction @3 line 3  [GsMethod OOP 131085569]
38 ComplexBlock in GRGemStonePlatform >> doTransaction: @11 line 18  [GsMethod OOP 166997249]
39 ComplexBlock in ExecutableBlock >> ensure: @7 line 13  [GsMethod OOP 2337281]
40 ComplexVCBlock in GRGemStonePlatform >> doTransaction: @13 line 18  [GsMethod OOP 166997249]
41 ComplexBlock in ExecutableBlock >> ensure: @4 line 11  [GsMethod OOP 2337281]
42 ComplexVCBlock in ExecutableBlock >> ensure: @6 line 11  [GsMethod OOP 2337281]
43 TransientRecursionLock >> critical: @15 line 8  [GsMethod OOP 22684929]
44 GRGemStonePlatform >> doTransaction: @14 line 8  [GsMethod OOP 166997249]
45 ZnGemServerLogSupport >> createContinuation: @8 line 5  [GsMethod OOP 240594433]
46 ZnGemServerLogSupport >> error: @2 line 2  [GsMethod OOP 240593153]
47 ZnSingleThreadedServer >> logServerError: @3 line 5  [GsMethod OOP 192040193]
48 ComplexBlock in ZnSingleThreadedServer >> handleRequestProtected: @8 line 11  [GsMethod OOP 192038145]
49 ExceptionHandler >> caughtExceptionWithAction: @5 line 4  [GsMethod OOP 11842049]
50 ComplexBlock in ExceptionHandler >> caughtEx:number:cat:args:handler: @12 line 13  [GsMethod OOP 11841537]
51 ComplexBlock in ExecutableBlock >> ensure: @4 line 11  [GsMethod OOP 2337281]
52 ComplexBlock in ExecutableBlock >> ensure: @6 line 11  [GsMethod OOP 2337281]
53 ExceptionHandler >> caughtEx:number:cat:args:handler: @16 line 14  [GsMethod OOP 11841537]
54 ComplexBlock in ExceptionHandler >> try:on:do: @10 line 15  [GsMethod OOP 11842817]
55 Exception >> _signal:number:args: @2 line 7  [GsMethod OOP 2365953]
56 ExceptionA >> signal @14 line 41  [GsMethod OOP 11828737]
57 ExceptionA >> signal: @3 line 12  [GsMethod OOP 11828993]
58 ExceptionA class >> signal: @2 line 3  [GsMethod OOP 13016833]
59 ZnDefaultServerDelegate >> errorResponse: @6 line 7  [GsMethod OOP 193078017]
60 ZnDefaultServerDelegate >> handleRequest: @16 line 10  [GsMethod OOP 188330241]
61 ComplexBlock in ZnSingleThreadedServer >> authenticateAndDelegateRequest: @8 line 12  [GsMethod OOP 192041473]
62 ComplexBlock in BlockClosure >> valueWithPossibleArgs: @12 line 5  [GsMethod OOP 20083457]
63 Object >> ifNil:ifNotNil: @2 line 4  [GsMethod OOP 108665089]
64 ComplexVCBlock in ZnSingleThreadedServer >> authenticateAndDelegateRequest: @9 line 11  [GsMethod OOP 192041473]
65 ComplexBlock in ZnSingleThreadedServer >> authenticateRequest:do: @3 line 6  [GsMethod OOP 192045313]
66 UndefinedObject >> ifNil:ifNotNil: @1 line 4  [GsMethod OOP 20151553]
67 ZnSingleThreadedServer >> authenticateRequest:do: @6 line 6  [GsMethod OOP 192045313]
68 ZnSingleThreadedServer >> authenticateAndDelegateRequest: @10 line 8  [GsMethod OOP 192041473]
69 ComplexBlock in ZnSingleThreadedServer >> handleRequestProtected: @3 line 5  [GsMethod OOP 192038145]
70 ExceptionHandler >> doTryBlock: @9 line 7  [GsMethod OOP 11842305]
71 ExceptionHandler >> try:on:do: @15 line 21  [GsMethod OOP 11842817]
72 ComplexBlock in ExecutableBlock >> on:do: @2 line 9  [GsMethod OOP 9571329]
73 ZnSingleThreadedServer >> handleRequestProtected: @11 line 6  [GsMethod OOP 192038145]
74 ZnSingleThreadedServer >> handleRequest: @4 line 9  [GsMethod OOP 239302145]
75 ComplexBlock in ZnTransactionSafeManagingMultiThreadedServer >> executeOneRequestResponseOn: @8 line 11  [GsMethod OOP 240564737]
76 ExceptionHandler >> doTryBlock: @9 line 7  [GsMethod OOP 11842305]
77 ExceptionHandler >> try:on:do: @15 line 21  [GsMethod OOP 11842817]
78 ComplexBlock in ExecutableBlock >> on:do: @2 line 9  [GsMethod OOP 9571329]
79 ComplexVCBlock in ZnTransactionSafeManagingMultiThreadedServer >> executeOneRequestResponseOn: @20 line 15  [GsMethod OOP 240564737]
80 ComplexVCBlock in BlockClosure >> valueWithPossibleArgs: @6 line 4  [GsMethod OOP 20083457]
81 Object >> ifNil:ifNotNil: @2 line 4  [GsMethod OOP 108665089]
82 ZnTransactionSafeManagingMultiThreadedServer >> executeOneRequestResponseOn: @21 line 8  [GsMethod OOP 240564737]
83 ComplexBlock in ZnTransactionSafeManagingMultiThreadedServer >> executeRequestResponseLoopOn: @7 line 9  [GsMethod OOP 240564225]
84 ComplexBlock in BlockClosure >> whileFalse @1 line 5  [GsMethod OOP 20082689]
85 ComplexVCBlock in ZnTransactionSafeManagingMultiThreadedServer >> executeRequestResponseLoopOn: @8 line 9  [GsMethod OOP 240564225]
86 ComplexBlock in DynamicVariable class >> value:during: @9 line 9  [GsMethod OOP 121530369]
87 ComplexBlock in ExecutableBlock >> ensure: @4 line 11  [GsMethod OOP 2337281]
88 ComplexBlock in ExecutableBlock >> ensure: @6 line 11  [GsMethod OOP 2337281]
89 DynamicVariable class >> value:during: @12 line 10  [GsMethod OOP 121530369]
90 ComplexVCBlock in ZnTransactionSafeManagingMultiThreadedServer >> executeRequestResponseLoopOn: @9 line 8  [GsMethod OOP 240564225]
91 ExceptionHandler >> doTryBlock: @9 line 7  [GsMethod OOP 11842305]
92 ExceptionHandler >> try:on:do: @15 line 21  [GsMethod OOP 11842817]
93 ComplexVCBlock in ExecutableBlock >> on:do: @2 line 9  [GsMethod OOP 9571329]
94 ZnTransactionSafeManagingMultiThreadedServer >> executeRequestResponseLoopOn: @17 line 10  [GsMethod OOP 240564225]
95 ComplexBlock in ZnTransactionSafeManagingMultiThreadedServer >> serveConnectionsOn: @25 line 20  [GsMethod OOP 240563969]
96 ExceptionHandler >> doTryBlock: @9 line 7  [GsMethod OOP 11842305]
97 ExceptionHandler >> try:on:do: @15 line 21  [GsMethod OOP 11842817]
98 ComplexBlock in ExecutableBlock >> on:do: @2 line 9  [GsMethod OOP 9571329]
99 ComplexVCBlock in ZnTransactionSafeManagingMultiThreadedServer >> serveConnectionsOn: @28 line 21  [GsMethod OOP 240563969]
100 ComplexBlock in ExecutableBlock >> ensure: @4 line 11  [GsMethod OOP 2337281]

This type of problem has not show up in Seaside, so I'm inclined to let this slide unless someone has a production-related issue

eliminate deprecated API calls?

While running ZN-Tests I noticed that we're hitting a bunch of deprecated api calls ... could be a Zinc test or we've got some incorrect calls..

port the text converters listed in ZnByteEncoder class>>#initializeByteTextConverters

initializeByteTextConverters
(ByteTextConverters := Dictionary new)
at: 'cp-1250' put: CP1250TextConverter;
at: 'cp-1253' put: CP1253TextConverter;
at: 'iso-8859-2' put: ISO88592TextConverter;
at: 'latin-2' put: ISO88592TextConverter;
at: 'latin2' put: ISO88592TextConverter;
at: 'iso-8859-7' put: ISO88597TextConverter;
at: 'iso-8859-15' put: ISO885915TextConverter

Missing GsSocket exceptions

Marten reports:

Zinc under Gemstone does not consider some GsSocket exceptions, which
under some circumstances crashes the server ...

ZnMessageBenchmark not functional

need to implement BlockClosure>>bench. Here's the Pharo implementation:

bench
    "Return how many times the receiver can get executed in 5 seconds.  Answer a meaningful description."
    "[3.14 printString] bench"

    | startTime endTime count roundTo3Digits  |
    roundTo3Digits := [:num |
               | rounded lowDigit |
               rounded := (num * 1000) rounded. "round to 1/1000"
               lowDigit := (rounded numberOfDigitsInBase: 10) - 3. "keep only first 3 digits"
               rounded := rounded roundTo:(10 raisedTo: lowDigit).
               (lowDigit >= 3 or: [rounded \\ 1000 = 0]) "display fractional part only when needed"
                       ifTrue: [(rounded // 1000) asStringWithCommas]
                       ifFalse: [(rounded / 1000.0) printString]].
    count := 0.
    endTime := Time millisecondClockValue + 5000.
    self assert: endTime < SmallInteger maxVal.
    startTime := Time millisecondClockValue.
    [ Time millisecondClockValue > endTime ] whileFalse: [ self value.  count := count + 1 ].
    endTime := Time millisecondClockValue.
    ^count = 1
        ifTrue: [ (roundTo3Digits value: (endTime - startTime) / 1000) , ' seconds.' ]
        ifFalse:  [ (roundTo3Digits value: (count * 1000) / (endTime - startTime)) , ' per second.' ]

This probably deserves to be in GsDevKit base, but I'm working on Issue #53 right now ...

Integer>>asWords needed

for now, ZnExampleStorageRestServerDelegateTest>>testQuery is an expected failure until Integer>>asWords added to GsDevKit.

Here's the Pharo implementation:

asWords
    "SmallInteger maxVal asWords"
    | mils minus three num answer milCount |
    self = 0 ifTrue: [^'zero'].
    mils := #('' ' thousand' ' million' ' billion' ' trillion' ' quadrillion' ' quintillion' ' sextillion' ' septillion' ' octillion' ' nonillion' ' decillion' ' undecillion' ' duodecillion' ' tredecillion' ' quattuordecillion' ' quindecillion' ' sexdecillion' ' septendecillion' ' octodecillion' ' novemdecillion' ' vigintillion').
    num := self.
    minus := ''.
    self < 0 ifTrue: [
        minus := 'negative '.
        num := num negated.
    ].
    answer := String new.
    milCount := 1.
    [num > 0] whileTrue: [
        three := (num \\ 1000) threeDigitName.
        num := num // 1000.
        three isEmpty ifFalse: [
            answer isEmpty ifFalse: [
                answer := ', ',answer
            ].
            answer := three,(mils at: milCount),answer.
        ].
        milCount := milCount + 1.
    ].
    ^minus,answer

Baseline references 'Zodiac-Core' package and new version of Metacello chokes

The new version of Metacello is more picky about name references and the following package ref in the baseline:

        package: 'Zinc-Zodiac'
          with: [ spec requires: #('Zinc-HTTP' 'Zodiac-Core' 'Zodiac-Tests') ];

References the package Zodiac-Core which is not present in the repository. In the configuration Zodiac-Core comes from the Zodiac repository:

      spec
        package: 'Zodiac-Core'
        with: [ spec repository: 'http://mc.stfx.eu/Zodiac' ].
      spec
        package: 'Zodiac-Tests'
        with: [ spec repository: 'http://mc.stfx.eu/Zodiac' ].

with the following versions:

        package: 'Zinc-Zodiac' with: 'Zinc-Zodiac-SvenVanCaekenberghe.27';
        package: 'Zodiac-Core' with: 'Zodiac-Core-SvenVanCaekenberghe.30';
        package: 'Zodiac-Tests' with: 'Zodiac-Tests-SvenVanCaekenberghe.12';

Zodiac provides https support and in the most recent versions of GemStone we support ssl in the base, so we should probably attempt to do the port ...

Until then, I think I will add the missing packages to the repository and the baseline (we have other packages that haven't been ported to GemStone) as reminders of the work to be done ...

clean up the package overrides

repackage the overrides in the GemStone packages ... take the opportunity to improve Pharo compatibility...

Zinc depends upon GLASS 1.0-beta.8.7.2.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.