Skip to content

Commit

Permalink
Fix for issue 1198: Restore of partial continuations does not preserv…
Browse files Browse the repository at this point in the history
…e GsProcess environment, breaking dynamic variables (#1201)

* Preserve GSProcess.environment across restore of partial continuation (fixes issue #1198)
* Fix for workaround in GRGemStonePlatform>>seasideSupendFlowDo: such that we only try to overwrite the environment when control is returned here as the result of restoring the partial continuation.
* Fix functional tests for running in Gemstone + add workaround fix to the partial continuation tests
* Converted use of Dictionary instance to use of a proper class (WAGemStoneProcessEnvironmentWrapper) in the implementation for the workaround for github issue 1198. Added a test for the specific case.
* do not use latestMetacello setting for gemstone builds
  • Loading branch information
jbrichau committed Jun 30, 2020
1 parent 9f9a232 commit 248af87
Show file tree
Hide file tree
Showing 205 changed files with 1,902 additions and 893 deletions.
1 change: 0 additions & 1 deletion .smalltalk.ston
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ SmalltalkCISpec {
#onWarningLog : true,
#onConflict : #useLoaded,
#load : [ 'CI' ],
#useLatestMetacello : true,
#platforms : [ #gemstone ]
}
],
Expand Down
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ matrix:
- smalltalk: Squeak-5.1
env: BUILD_NAME=Squeak-5.1

- smalltalk: GemStone-3.5.0
env: BUILD_NAME=GemStone-3.5.0
- smalltalk: GemStone-3.5.2
env: BUILD_NAME=GemStone-3.5.2
cache:
directories:
- $SMALLTALK_CI_CACHE
- smalltalk: GemStone-3.4.3
env: BUILD_NAME=GemStone-3.4.3
- smalltalk: GemStone-3.4.5
env: BUILD_NAME=GemStone-3.4.5
cache:
directories:
- $SMALLTALK_CI_CACHE
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ See the travis dashboard: https://travis-ci.org/SeasideSt/Seaside/branches
### master
Pharo | Squeak | GemStone/S
------------ | ------------- | ------------
[![Build status: Pharo-8.0](http://badges.herokuapp.com/travis/SeasideSt/Seaside?branch=master&env=BUILD_NAME=Pharo64-8.0&label=8.0)](http://travis-ci.org/SeasideSt/Seaside) | [![Build status: Squeak-5.2](http://badges.herokuapp.com/travis/SeasideSt/Seaside?branch=master&env=BUILD_NAME=Squeak-5.2&label=5.2)](http://travis-ci.org/SeasideSt/Seaside) | [![Build status: GemStone-3.5.0](http://badges.herokuapp.com/travis/SeasideSt/Seaside?branch=master&env=BUILD_NAME=GemStone-3.5.0&label=3.5.0)](http://travis-ci.org/SeasideSt/Seaside)
[![Build status: Pharo-7.0](http://badges.herokuapp.com/travis/SeasideSt/Seaside?branch=master&env=BUILD_NAME=Pharo64-7.0&label=7.0)](http://travis-ci.org/SeasideSt/Seaside) | [![Build status: Squeak-5.1](http://badges.herokuapp.com/travis/SeasideSt/Seaside?branch=master&env=BUILD_NAME=Squeak-5.1&label=5.1)](http://travis-ci.org/SeasideSt/Seaside) | [![Build status: GemStone-3.4.3](http://badges.herokuapp.com/travis/SeasideSt/Seaside?branch=master&env=BUILD_NAME=GemStone-3.4.3&label=3.4.3)](http://travis-ci.org/SeasideSt/Seaside)
[![Build status: Pharo-8.0](http://badges.herokuapp.com/travis/SeasideSt/Seaside?branch=master&env=BUILD_NAME=Pharo64-8.0&label=8.0)](http://travis-ci.org/SeasideSt/Seaside) | [![Build status: Squeak-5.2](http://badges.herokuapp.com/travis/SeasideSt/Seaside?branch=master&env=BUILD_NAME=Squeak-5.2&label=5.2)](http://travis-ci.org/SeasideSt/Seaside) | [![Build status: GemStone-3.5.2](http://badges.herokuapp.com/travis/SeasideSt/Seaside?branch=master&env=BUILD_NAME=GemStone-3.5.2&label=3.5.2)](http://travis-ci.org/SeasideSt/Seaside)
[![Build status: Pharo-7.0](http://badges.herokuapp.com/travis/SeasideSt/Seaside?branch=master&env=BUILD_NAME=Pharo64-7.0&label=7.0)](http://travis-ci.org/SeasideSt/Seaside) | [![Build status: Squeak-5.1](http://badges.herokuapp.com/travis/SeasideSt/Seaside?branch=master&env=BUILD_NAME=Squeak-5.1&label=5.1)](http://travis-ci.org/SeasideSt/Seaside) | [![Build status: GemStone-3.4.5](http://badges.herokuapp.com/travis/SeasideSt/Seaside?branch=master&env=BUILD_NAME=GemStone-3.4.5&label=3.4.5)](http://travis-ci.org/SeasideSt/Seaside)
[![Build status: Pharo-6.1](http://badges.herokuapp.com/travis/SeasideSt/Seaside?branch=master&env=BUILD_NAME=Pharo-6.1&label=6.1)](http://travis-ci.org/SeasideSt/Seaside) | - | [![Build status: GemStone-3.3.9](http://badges.herokuapp.com/travis/SeasideSt/Seaside?branch=master&env=BUILD_NAME=GemStone-3.3.9&label=3.3.9)](http://travis-ci.org/SeasideSt/Seaside)
[![Build status: Pharo-5.0](http://badges.herokuapp.com/travis/SeasideSt/Seaside?branch=master&env=BUILD_NAME=Pharo-5.0&label=5.0)](http://travis-ci.org/SeasideSt/Seaside) | - | [![Build status: GemStone-3.2.17](http://badges.herokuapp.com/travis/SeasideSt/Seaside?branch=master&env=BUILD_NAME=GemStone-3.2.17&label=3.2.17)](http://travis-ci.org/SeasideSt/Seaside)
[![Build status: Pharo-4.0](http://badges.herokuapp.com/travis/SeasideSt/Seaside?branch=master&env=BUILD_NAME=Pharo-4.0&label=4.0)](http://travis-ci.org/SeasideSt/Seaside) | - | [![Build status: GemStone-3.1.0.6](http://badges.herokuapp.com/travis/SeasideSt/Seaside?branch=master&env=BUILD_NAME=GemStone-3.1.0.6&label=3.1.0.6)](http://travis-ci.org/SeasideSt/Seaside)
Expand All @@ -138,8 +138,8 @@ Pharo | Squeak | GemStone/S
### development
Pharo | Squeak | GemStone/S
------------ | ------------- | ------------
[![Build status: Pharo-8.0](http://badges.herokuapp.com/travis/SeasideSt/Seaside?branch=develop&env=BUILD_NAME=Pharo64-8.0&label=8.0)](http://travis-ci.org/SeasideSt/Seaside) | [![Build status: Squeak-5.2](http://badges.herokuapp.com/travis/SeasideSt/Seaside?branch=develop&env=BUILD_NAME=Squeak-5.2&label=5.2)](http://travis-ci.org/SeasideSt/Seaside) | [![Build status: GemStone-3.5.0](http://badges.herokuapp.com/travis/SeasideSt/Seaside?branch=develop&env=BUILD_NAME=GemStone-3.5.0&label=3.5.0)](http://travis-ci.org/SeasideSt/Seaside)
[![Build status: Pharo-7.0](http://badges.herokuapp.com/travis/SeasideSt/Seaside?branch=develop&env=BUILD_NAME=Pharo64-7.0&label=7.0)](http://travis-ci.org/SeasideSt/Seaside) | [![Build status: Squeak-5.1](http://badges.herokuapp.com/travis/SeasideSt/Seaside?branch=develop&env=BUILD_NAME=Squeak-5.1&label=5.1)](http://travis-ci.org/SeasideSt/Seaside) | [![Build status: GemStone-3.4.3](http://badges.herokuapp.com/travis/SeasideSt/Seaside?branch=develop&env=BUILD_NAME=GemStone-3.4.3&label=3.4.3)](http://travis-ci.org/SeasideSt/Seaside)
[![Build status: Pharo-8.0](http://badges.herokuapp.com/travis/SeasideSt/Seaside?branch=develop&env=BUILD_NAME=Pharo64-8.0&label=8.0)](http://travis-ci.org/SeasideSt/Seaside) | [![Build status: Squeak-5.2](http://badges.herokuapp.com/travis/SeasideSt/Seaside?branch=develop&env=BUILD_NAME=Squeak-5.2&label=5.2)](http://travis-ci.org/SeasideSt/Seaside) | [![Build status: GemStone-3.5.2](http://badges.herokuapp.com/travis/SeasideSt/Seaside?branch=develop&env=BUILD_NAME=GemStone-3.5.2&label=3.5.2)](http://travis-ci.org/SeasideSt/Seaside)
[![Build status: Pharo-7.0](http://badges.herokuapp.com/travis/SeasideSt/Seaside?branch=develop&env=BUILD_NAME=Pharo64-7.0&label=7.0)](http://travis-ci.org/SeasideSt/Seaside) | [![Build status: Squeak-5.1](http://badges.herokuapp.com/travis/SeasideSt/Seaside?branch=develop&env=BUILD_NAME=Squeak-5.1&label=5.1)](http://travis-ci.org/SeasideSt/Seaside) | [![Build status: GemStone-3.4.5](http://badges.herokuapp.com/travis/SeasideSt/Seaside?branch=develop&env=BUILD_NAME=GemStone-3.4.5&label=3.4.5)](http://travis-ci.org/SeasideSt/Seaside)
[![Build status: Pharo-6.1](http://badges.herokuapp.com/travis/SeasideSt/Seaside?branch=develop&env=BUILD_NAME=Pharo-6.1&label=6.1)](http://travis-ci.org/SeasideSt/Seaside) | - | [![Build status: GemStone-3.3.9](http://badges.herokuapp.com/travis/SeasideSt/Seaside?branch=develop&env=BUILD_NAME=GemStone-3.3.9&label=3.3.9)](http://travis-ci.org/SeasideSt/Seaside)
[![Build status: Pharo-5.0](http://badges.herokuapp.com/travis/SeasideSt/Seaside?branch=develop&env=BUILD_NAME=Pharo-5.0&label=5.0)](http://travis-ci.org/SeasideSt/Seaside) | - | [![Build status: GemStone-3.2.17](http://badges.herokuapp.com/travis/SeasideSt/Seaside?branch=develop&env=BUILD_NAME=GemStone-3.2.17&label=3.2.17)](http://travis-ci.org/SeasideSt/Seaside)
[![Build status: Pharo-4.0](http://badges.herokuapp.com/travis/SeasideSt/Seaside?branch=develop&env=BUILD_NAME=Pharo-4.0&label=4.0)](http://travis-ci.org/SeasideSt/Seaside) | - | [![Build status: GemStone-3.1.0.6](http://badges.herokuapp.com/travis/SeasideSt/Seaside?branch=develop&env=BUILD_NAME=GemStone-3.1.0.6&label=3.1.0.6)](http://travis-ci.org/SeasideSt/Seaside)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"class" : {
"seasideGemStoneContinuation" : "JohanBrichau 05/24/2020 08:27:30" },
"instance" : {
} }
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"class" : {
},
"instance" : {
"valueWithPossibleArguments:" : "JohanBrichau 05/24/2020 08:27:30" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*seaside-gemstone-continuation
isProcessEnvironmentWrapper
^ false
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"class" : {
},
"instance" : {
"isProcessEnvironmentWrapper" : "JohanBrichau 06/27/2020 04:11" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
"name" : "Object" }
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"class" : {
"current" : "JohanBrichau 05/24/2020 08:27:30",
"currentDo:" : "JohanBrichau 05/24/2020 08:27:30",
"fromContinuation:" : "JohanBrichau 05/24/2020 08:27:30" },
"instance" : {
"initializeFromContinuation:" : "JohanBrichau 05/24/2020 08:27:30",
"numArgs" : "JohanBrichau 05/24/2020 08:27:30",
"value" : "JohanBrichau 05/24/2020 08:27:30",
"value:" : "JohanBrichau 05/24/2020 08:27:30",
"valueWithArguments:" : "JohanBrichau 05/24/2020 08:27:30" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
I am a helper to implement a workaround to pass the environment of the GsProcess where a partial continuation is restored, such that GRDynamicVariable works as expected in the presence of partial continuations. See https://github.com/SeasideSt/Seaside/issues/1198
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
instance creation
withEnvironment: aProcessEnvironment value: anObject
^ self basicNew environment: aProcessEnvironment value: anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
initialization
environment: aProcessEnvironment value: anObject
environment := aProcessEnvironment.
value := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
testing
isProcessEnvironmentWrapper
^ true
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
restoreEnvironmentAndReturnValue
Processor activeProcess environment: environment.
^ value
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"class" : {
"withEnvironment:value:" : "JohanBrichau 06/27/2020 04:04" },
"instance" : {
"environment:value:" : "JohanBrichau 06/27/2020 04:03",
"isProcessEnvironmentWrapper" : "JohanBrichau 06/27/2020 04:10",
"restoreEnvironmentAndReturnValue" : "JohanBrichau 06/27/2020 04:12" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"category" : "Seaside-GemStone-Continuation",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "JohanBrichau 06/27/2020 04:14",
"instvars" : [
"environment",
"value" ],
"name" : "WAGemStoneProcessEnvironmentWrapper",
"pools" : [
],
"super" : "Object",
"type" : "normal" }
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"class" : {
},
"instance" : {
} }
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
],
"classvars" : [
],
"commentStamp" : "DaleHenrichs 06/02/2010 12:37",
"commentStamp" : "",
"instvars" : [
],
"name" : "WAMarkerNotFound",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
evaluating
value: anObject

| marker frameIndex |
marker := self markerBlock value.
marker isNil
ifTrue: [
marker := ((GsProcess _frameContentsAt: 2) at: 1).
frameIndex := 2 ]
ifFalse: [ frameIndex := self class findFrameIndexFor: marker ].
^GsProcess
installPartialContinuation: partial
atLevel: frameIndex
value: anObject
value: anObject
| marker frameIndex |
marker := self markerBlock value.
marker isNil
ifTrue: [
marker := (GsProcess _frameContentsAt: 2) at: 1.
frameIndex := 2 ]
ifFalse: [ frameIndex := self class findFrameIndexFor: marker ]. "We not only pass through the result value when restoring the continuation, but also the current process environment as a workaround to restore the environment once the partial continuation is restored. This is needed to keep GRDynamicVariable working."
^ GsProcess
installPartialContinuation: partial
atLevel: frameIndex
value:
(WAGemStoneProcessEnvironmentWrapper
withEnvironment: Processor activeProcess environment
value: anObject)
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"class" : {
"currentDo:markerBlock:" : "JohanBrichau 05/24/2020 08:27:30",
"findFrameIndexFor:" : "JohanBrichau 05/24/2020 08:27:30",
"to:offset:markerBlock:" : "JohanBrichau 05/24/2020 08:27:30" },
"instance" : {
"markerBlock" : "JohanBrichau 05/24/2020 08:27:30",
"markerBlock:" : "JohanBrichau 05/24/2020 08:27:30",
"value" : "JohanBrichau 05/24/2020 08:27:30",
"value:" : "JohanBrichau 06/27/2020 04:07",
"valueWithArguments:" : "JohanBrichau 05/24/2020 08:27:30",
"valueWithPossibleArguments:" : "JohanBrichau 05/24/2020 08:27:30",
"with:" : "JohanBrichau 05/24/2020 08:27:30" } }
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
],
"classvars" : [
],
"commentStamp" : "DaleHenrichs 06/02/2010 12:37",
"commentStamp" : "",
"instvars" : [
"partial",
"markerBlock" ],
Expand Down
Loading

0 comments on commit 248af87

Please sign in to comment.