Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
… into GsDevKit-master

Conflicts:
	bin/startGemServerGem
  • Loading branch information
dalehenrich committed Jul 16, 2015
2 parents 6a07133 + 898232b commit 7ee50d3
Show file tree
Hide file tree
Showing 44 changed files with 108 additions and 65 deletions.
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ env:
- ST=GemStone-3.0.1
- ST=GemStone-3.1.0.6
- ST=GemStone-3.2.0
- ST=GemStone-3.2.1
- ST=GemStone-3.2.2
- ST=GemStone-3.2.3
- ST=GemStone-3.2.7

install:
- export PROJECT_HOME="$(pwd)"
Expand Down
9 changes: 5 additions & 4 deletions bin/startGemServerGem
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

GemServer="$1"
Port="$2"
PortName=`echo ${Port} | sed "s/'//g"` #strip ' off in case of a non-integer argument

set -e # exit on error

Expand Down Expand Up @@ -52,7 +53,7 @@ logDir=${GEMSTONE_LOGDIR}
if [ "${logDir}x" = "x" ] ; then
logDir=/opt/gemstone/log
fi
logFile="${logDir}/${GemServer}_server-${Port}.log"
logFile="${logDir}/${GemServer}_server-${PortName}.log"

username=$GEMSTONE_USER_NAME
if [ "${GEMSTONE_USER_NAME}x" = "x" ] ; then
Expand All @@ -71,18 +72,18 @@ iferror stack
login
run
(GemServerRegistry gemServerNamed: '$GemServer') scriptStartServiceOn: '$Port'.
(GemServerRegistry gemServerNamed: '$GemServer') scriptStartServiceOn: $Port.
%
run
| logEntry |
System beginTransaction.
(logEntry := ObjectLogEntry
fatal: '${GemServer}_server_${Port}: topaz exit'
fatal: '${GemServer}_server_${PortName}: topaz exit'
object:
'pid: ', (System gemVersionReport at: 'processId') printString) addToLog.
(GemServerRegistry gemServerNamed: '$GemServer')
ifNotNil: [:gemServer | gemServer crashLog add: ('$Port') asString -> logEntry ].
ifNotNil: [:gemServer | gemServer crashLog add: (${PortName}) asString -> logEntry ].
System commitTransaction.
%
Expand Down
6 changes: 5 additions & 1 deletion bin/stopGemServerGem
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,24 @@

GemServer="$1"
Port="$2"
PortName=`echo ${Port} | sed "s/'//g"` #strip ' off in case of a non-integer argument

# must match GemServer>>gemPidFileName:

logDir=${GEMSTONE_LOGDIR}
if [ "${logDir}x" = "x" ] ; then
logDir=/opt/gemstone/log
fi
pidfile="${logDir}/${GemServer}_server-${Port}.pid"
pidfile="${logDir}/${GemServer}_server-${PortName}.pid"

if [ -e $pidfile ]; then
pid=`cat $pidfile`
rm $pidfile
echo " Stopping topaz PID $pid running on port $port"
kill $pid
while [[ ( -d /proc/$pid ) && ( -z `grep zombie /proc/$pid/status` ) ]]; do
sleep 1
done
else
echo " No PID file found for gem on port $port, not running?"
fi
Expand Down
22 changes: 11 additions & 11 deletions docs/gettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ If you are not using auto commit mode, then an explicit commit is needed.*
gemServer := GemServer gemServerNamed: 'example'.
client := gemServer clientClass new.
result := client
submitAndWaitFor: { #scheduleError }
submitAndWaitFor: { #scheduleErrorTask }
gemServer: gemServer.
```

Expand Down Expand Up @@ -958,7 +958,7 @@ If you are not using auto commit mode, then an explicit commit is needed.*
transaction. However, work you have done within your own object space is not affected
by an abortTransaction. GemStone gives you a new view of the repository that does
not include any changes you made to permanent objects during the aborted
transaction—because the transaction was aborted, your changes did not affect objects in
transaction—because the transaction was aborted, your changes did not affect objects in
the repository. The new view, however, does include changes committed by other users
since your last transaction started. Objects that you have created in the GemBuilder for
Smalltalk object space, outside the repository, remain until you remove them or end your
Expand Down Expand Up @@ -1006,13 +1006,13 @@ either explicitly begin a new one or change transaction modes.*

---

*Sessions only update their view of the repository when they commit or abort. The repository must keep a copy of each session’s view so long as the session is using it, even if other sessions frequently commit changes and create new views (commit records). Storing the original view and all the intermediate views uses up space in the repository, and can result in the repository running out of space. To avoid this problem, all sessions in a busy system should commit or abort regularly.*
*Sessions only update their view of the repository when they commit or abort. The repository must keep a copy of each session’s view so long as the session is using it, even if other sessions frequently commit changes and create new views (commit records). Storing the original view and all the intermediate views uses up space in the repository, and can result in the repository running out of space. To avoid this problem, all sessions in a busy system should commit or abort regularly.*

*For a session that is not in a transaction, if the number of commit records exceeds the
value of STN_CR_BACKLOG_THRESHOLD, the Stone repository monitor signals the session to abort by signaling TransactionBacklog (also called “sigAbort”). If the session does not abort, the Stone repository monitor reinitializes the session or terminates it, depending on the value of STN_GEM_LOSTOT_TIMEOUT.*
value of STN_CR_BACKLOG_THRESHOLD, the Stone repository monitor signals the session to abort by signaling TransactionBacklog (also called “sigAbort”). If the session does not abort, the Stone repository monitor reinitializes the session or terminates it, depending on the value of STN_GEM_LOSTOT_TIMEOUT.*

*Sessions that are in transaction are not subject to losing their view forcibly. Sessions in
transaction enable receipt of the signal TransactionBacklog, and handle it appropriately, but it is optional. It is important that sessions do not stay in transaction for long periods in busy systems; this can result in the Stone running out of space and shutting down. However, sessions that run in automatic transaction mode are always in transaction; as soon as they commit or abort, they begin a new transaction. (For a discussion of automatic and manual transaction modes, see the Transactions and Concurrency Control” chapter of the GemStone/S 64 Bit Programming Guide.) *
transaction enable receipt of the signal TransactionBacklog, and handle it appropriately, but it is optional. It is important that sessions do not stay in transaction for long periods in busy systems; this can result in the Stone running out of space and shutting down. However, sessions that run in automatic transaction mode are always in transaction; as soon as they commit or abort, they begin a new transaction. (For a discussion of automatic and manual transaction modes, see the “Transactions and Concurrency Control” chapter of the GemStone/S 64 Bit Programming Guide.) *

---

Expand Down Expand Up @@ -1074,7 +1074,7 @@ Smalltalk model).*

---

*GemStone prevents conflict between users by encapsulating each session’s operations
*GemStone prevents conflict between users by encapsulating each session’s operations
(computations, stores, and fetches) in units called transactions. The operations that make
up a transaction act on what appears to you to be a private view of GemStone objects.
When you tell GemStone to commit the current transaction, GemStone tries to merge the
Expand All @@ -1084,7 +1084,7 @@ modified objects in your view with the shared object store.*

*Every user session maintains its own consistent view of the
repository state. Objects that the repository contained at the beginning of your session are
preserved in your view, even if you are not using them—and even if other users’ actions
preserved in your view, even if you are not using them—and even if other users’ actions
have rendered them obsolete. The storage that those objects are using cannot be reclaimed
until you commit or abort your transaction. Depending upon the characteristics of your
particular installation (such as the number of users and the commit frequency), this
Expand Down Expand Up @@ -1175,7 +1175,7 @@ your application, they are copied to temporary object memory.*
*Some of these objects may ultimately become permanent and reside on the disk, but
probably not all of them. Temporary objects that your application creates merely in order
to do its work reside in temporary object space until they are no longer needed, when the
Gem’s garbage collector reclaims the storage they use.*
Gem’s garbage collector reclaims the storage they use.*

*It is important to provide sufficient temporary object space. At the same time, you must
design your application so that it does not create an infinite amount of reachable
Expand All @@ -1194,10 +1194,10 @@ and terminate.*
*GemStone detects conflict by comparing your read and write sets with those of all other
transactions committed since your transaction began. The following conditions signal a
possible concurrency conflict:*
- *An object in your write set is also in the write set of another transaction—a write-write
- *An object in your write set is also in the write set of another transaction—a write-write
conflict. Write-write conflicts can involve only a single object.*
- *An object in your write set is also in another session’s dependency list—a writedependency
conflict. An object belongs to a session’s dependency list if the session has
- *An object in your write set is also in another session’s dependency list—a writedependency
conflict. An object belongs to a session’s dependency list if the session has
added, removed, or changed a dependency (index) for that object. For details about
how GemStone creates and manages indexes on collections, see Chapter 7, Indexes
and Querying.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"class" : {
},
"instance" : {
"baseline:" : "dkh 12/26/2014 11:59" } }
"baseline:" : "dkh 07/15/2015 17:34" } }
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(name 'BaselineOfGsApplicationTools-dkh.8' message 'Issue #10: change baseline to require GLASS1...clean up sent but not implemented' id '87cb8c31-5c93-432a-aa56-919a9717192c' date '12/26/2014' time '12:05:27' author 'dkh' ancestors ((name 'BaselineOfGsApplicationTools-dkh.7' message 'Issue #10: breakpoint, halt and another http example' id '3ac7606c-22da-4206-9d45-446a8c2b09e9' date '12/23/2014' time '16:28:41' author 'dkh' ancestors ((name 'BaselineOfGsApplicationTools-dkh.6' message 'Issue #10: expand gemserver api a bit more ... add simple test for GemServerRemoteServerExample and it is passing' id 'b48a9dcd-2492-4eaa-b60c-b9e187f8e8c0' date '12/23/2014' time '14:01:05' author 'dkh' ancestors ((name 'BaselineOfGsApplicationTools-dkh.5' message 'Issue #10: add GemServer>>gemServer: and GemServer>>gemServer:onError: as non-transactional veriants for handling server errors, breakpoints and halts (should satisfy Issue #12)...refactor GemServer>>gemServerTransaction:onError: to use GemServer>>gemServer:onError: ... add GemServer>>handleGemServerException: to isolate server error and interactiveMoe logic ... GemServer>>serverError:titled:inTransactionDo: allows for performing optional work in the same transaction as the continuation ... if one is already in transaction a commit is expected to come from the caller ... started work on an example server as the GemServerTestServer has been sacrificed to being able to test various error conditions and is no longer a clean example ...' id '83fef897-46b4-46cb-ab20-c3224414c21e' date '12/23/2014' time '11:19:31' author 'dkh' ancestors ((name 'BaselineOfGsApplicationTools-dkh.4' message 'Issue #2: split out GemServer>>performOnServer: into separate 2.4 and 3.x packages ... add new packages and update baseline' id '04a850bf-fa2b-4431-aaf6-c2881f208745' date '11/29/2014' time '19:14:19' author 'dkh' ancestors ((name 'BaselineOfGsApplicationTools-dkh.3' message 'Issue #2: correct mistakes in baseline for package renames' id 'fd5a3af5-23ff-4999-8f85-014970aa05e1' date '11/26/2014' time '14:35:15' author 'dkh' ancestors ((name 'BaselineOfGsApplicationTools-dkh.2' message 'Issue #2: rename packages to have GsApplication-Tools as base name' id 'dde6d24e-71be-4e7e-acc1-cca1b40370bb' date '11/26/2014' time '14:25:46' author 'dkh' ancestors ((name 'BaselineOfGsApplicationTools-dkh.1' message 'Issue #1: define baseline' id '716d27b8-3b41-4a1e-ac1e-60496cf001e3' date '11/26/2014' time '11:18:40' author 'dkh' ancestors () stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())
(name 'BaselineOfGsApplicationTools-dkh.10' message 'Issue #35: the package GsApplicationTools-ServerExtensionsV30 with GsProcess>>convertToPortableStack is not needed ...' id '79dbd8f9-25ca-4ab3-8dc3-c583689b24dc' date '07/15/2015' time '17:34:53' author 'dkh' ancestors ((name 'BaselineOfGsApplicationTools-dkh.9' message 'Issue #35: implement GsProcess>>convertToPortableStack for GemStone versions 3.0 thru 3.2 in package GsApplicationTools-ServerExtensionsV30' id 'd7cd8b66-fa67-4946-af11-a92e59c839ed' date '07/15/2015' time '17:06:38' author 'dkh' ancestors ((name 'BaselineOfGsApplicationTools-dkh.8' message 'Issue #10: change baseline to require GLASS1...clean up sent but not implemented' id '87cb8c31-5c93-432a-aa56-919a9717192c' date '12/26/2014' time '12:05:27' author 'dkh' ancestors ((name 'BaselineOfGsApplicationTools-dkh.7' message 'Issue #10: breakpoint, halt and another http example' id '3ac7606c-22da-4206-9d45-446a8c2b09e9' date '12/23/2014' time '16:28:41' author 'dkh' ancestors ((name 'BaselineOfGsApplicationTools-dkh.6' message 'Issue #10: expand gemserver api a bit more ... add simple test for GemServerRemoteServerExample and it is passing' id 'b48a9dcd-2492-4eaa-b60c-b9e187f8e8c0' date '12/23/2014' time '14:01:05' author 'dkh' ancestors ((name 'BaselineOfGsApplicationTools-dkh.5' message 'Issue #10: add GemServer>>gemServer: and GemServer>>gemServer:onError: as non-transactional veriants for handling server errors, breakpoints and halts (should satisfy Issue #12)...refactor GemServer>>gemServerTransaction:onError: to use GemServer>>gemServer:onError: ... add GemServer>>handleGemServerException: to isolate server error and interactiveMoe logic ... GemServer>>serverError:titled:inTransactionDo: allows for performing optional work in the same transaction as the continuation ... if one is already in transaction a commit is expected to come from the caller ... started work on an example server as the GemServerTestServer has been sacrificed to being able to test various error conditions and is no longer a clean example ...' id '83fef897-46b4-46cb-ab20-c3224414c21e' date '12/23/2014' time '11:19:31' author 'dkh' ancestors ((name 'BaselineOfGsApplicationTools-dkh.4' message 'Issue #2: split out GemServer>>performOnServer: into separate 2.4 and 3.x packages ... add new packages and update baseline' id '04a850bf-fa2b-4431-aaf6-c2881f208745' date '11/29/2014' time '19:14:19' author 'dkh' ancestors ((name 'BaselineOfGsApplicationTools-dkh.3' message 'Issue #2: correct mistakes in baseline for package renames' id 'fd5a3af5-23ff-4999-8f85-014970aa05e1' date '11/26/2014' time '14:35:15' author 'dkh' ancestors ((name 'BaselineOfGsApplicationTools-dkh.2' message 'Issue #2: rename packages to have GsApplication-Tools as base name' id 'dde6d24e-71be-4e7e-acc1-cca1b40370bb' date '11/26/2014' time '14:25:46' author 'dkh' ancestors ((name 'BaselineOfGsApplicationTools-dkh.1' message 'Issue #1: define baseline' id '716d27b8-3b41-4a1e-ac1e-60496cf001e3' date '11/26/2014' time '11:18:40' author 'dkh' ancestors () stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
accessing
basicTransactionReentry
basicTransactionReentry value
ifNil: [ basicTransactionReentry value: self reentryAllowed ].
ifNil: [
self _setNoStubbing. "as long as I am in memory prevent stubbing of my instance variables ... I will stay in memory as long as I am referenced from stack.."
basicTransactionReentry value: self reentryAllowed ].
^ basicTransactionReentry value
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
server specialization
executeStartGemCommand: portOrResourceName
| commandLine |
commandLine := self startScriptPath , ' ' , self name , ' '
, portOrResourceName asString , ' "' , self exeConfPath , '"'.
commandLine := self startScriptPath , ' ' , self name , ' "'
, portOrResourceName printString , '" "' , self exeConfPath , '"'.
self performOnServer: commandLine
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
server specialization
isRunning
^self serverClass isRunning
^self serverClass isRunning
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ accessing
name

name == nil ifTrue: [ ^self serverClass name ].
^name
^name
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ service instance-control
restartGems
self logControlEvent: 'Restart Gems: ' , self name.
self stopGems.
(Delay forSeconds: 3) wait. "give gem a chance to close sockets"
self startGems
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
service instance-control
waitForStartGems: timeOutSeconds
| pidList count |
pidList := ''.
count := 0.
self logControlEvent: 'Wait for Gems: ' , self name.
self portOrResourceNameList
do: [ :portOrResourceName |
| pidFilePath file |
pidFilePath := self gemPidFileName: portOrResourceName.
[ GsFile existsOnServer: pidFilePath ]
whileFalse: [
(Delay forSeconds: 1) wait.
count := count + 1.
count > timeOutSeconds
ifTrue: [ ^ false ] ] ].
^ true
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"basicServerOn:" : "dkh 01/03/2015 15:54",
"basicServerProcess" : "dkh 01/02/2015 17:13",
"basicServerProcess:" : "dkh 01/02/2015 17:13",
"basicTransactionReentry" : "dkh 01/09/2015 14:20",
"basicTransactionReentry" : "dkh 04/03/2015 11:44",
"basicTransactionReentry:" : "dkh 01/09/2015 13:16",
"bounceServerAfterSetOrClearBreakpoints:" : "dkh 12/09/2014 14:12",
"bounceServerForBreakpointHandling" : "dkh 12/10/2014 14:48",
Expand All @@ -39,7 +39,7 @@
"enableRemoteBreakpoints" : "dkh 12/10/2014 17:01",
"enableRemoteBreakpoints:" : "dkh 11/26/2014 19:16",
"exeConfPath" : "dkh 01/01/2015 16:54",
"executeStartGemCommand:" : "dkh 01/06/2015 15:31",
"executeStartGemCommand:" : "dkh 05/27/2015 17:02",
"executeStatusGemCommand:" : "dkh 12/20/2014 21:46",
"executeStopGemCommand:" : "dkh 01/06/2015 15:30",
"gemPidFileName:" : "dkh 01/26/2015 15:07",
Expand Down Expand Up @@ -79,7 +79,7 @@
"initialize" : "dkh 01/09/2015 14:21",
"interactiveMode" : "dkh 12/22/2014 12:55",
"interactiveMode:" : "dkh 12/22/2014 12:57",
"interactiveStartServiceOn:" : "dkh 01/06/2015 15:51",
"interactiveStartServiceOn:" : "dkh 01/16/2015 11:54",
"interactiveStartServiceOn:transactionMode:" : "dkh 01/06/2015 15:50",
"isRunning" : "SebastianHeidbrink 11/02/2014 15:00",
"isValidName:" : "dkh 11/26/2014 18:31",
Expand All @@ -99,7 +99,7 @@
"reentryAllowed" : "dkh 01/09/2015 13:12",
"reentryDisallowed" : "dkh 01/09/2015 13:11",
"register" : "dkh 01/06/2015 13:39",
"restartGems" : "dkh 12/06/2014 13:04",
"restartGems" : "dkh 05/27/2015 16:24",
"saveContinuationFor:titled:inTransactionDo:" : "dkh 12/30/2014 07:25",
"scriptBinDirPath" : "dkh 11/29/2014 09:44",
"scriptLogEvent:object:" : "dkh 01/09/2015 17:18",
Expand Down Expand Up @@ -132,4 +132,5 @@
"transactionMutex" : "dkh 12/22/2014 14:48",
"unregister" : "dkh 01/06/2015 13:39",
"validateName:" : "dkh 11/26/2014 18:29",
"waitForStartGems:" : "dkh 05/28/2015 00:47",
"writeGemLogEntryFor:titled:" : "dkh 01/06/2015 16:49" } }
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accessing
block: anObject

block := anObject
block := anObject
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accessing
nativeProcess: anObject

nativeProcess := anObject
nativeProcess := anObject
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accessing
nativeProcess

^nativeProcess
^nativeProcess
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accessing
nativeSemaphore: anObject

nativeSemaphore := anObject
nativeSemaphore := anObject
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accessing
portableProcess: anObject

portableProcess := anObject
portableProcess := anObject
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accessing
portableProcess

^portableProcess
^portableProcess
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accessing
portableSemaphore: anObject

portableSemaphore := anObject
portableSemaphore := anObject
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
gem server querying
gemServerNamed: aString
^self singleton serverNamed: aString
^self singleton serverNamed: aString
Loading

0 comments on commit 7ee50d3

Please sign in to comment.