Pharo-dev
By thread
pharo-dev@lists.pharo.org
By month
Messages by month
- ----- 2026 -----
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
September 2011
- 91 participants
- 1128 messages
Re: [Pharo-project] Zinc crashing image at start up
by Philippe Marschall
On 03.09.2011 13:57, Igor Stasenko wrote:
> On 3 September 2011 12:57, Philippe Marschall <kustos(a)gmx.net> wrote:
>> On 02.09.2011 17:19, Igor Stasenko wrote:
>>> On 2 September 2011 17:27, Philippe Marschall <kustos(a)gmx.net> wrote:
>>>> On 02.09.2011 15:39, Igor Stasenko wrote:
>>>>> Looks like it tries to destroy socket which were left from previous session,
>>>>> and of course fails because in newly started image the socket handle invalid.
>>>>
>>>> Sure, but that should signal #primitiveFailed, not segfault the vm.
>>>>
>>> according to log, there is a primitive fail.
>>> do you have a crash.dmp log?
>>
>> No
>>
>
> just want to clear, is it segfaults or just quits because of error at startup?
Not sure, how can I tell the difference?
Cheers
Philippe
Sept. 4, 2011
[Pharo-project] Towards better HTTP client usage
by Sven Van Caekenberghe
Towards better HTTP client usage
At the last Pharo Sprint in Lille (July 8th), Stéphane and I were at one point trying to remove some old HTTPSocket usage (which indirectly uses Zn) and replace it with direct and clean Zn usage. We hadn't much time left and didn't get very far. But I realized afterwards that although technically everything was there to write good HTTP client code, it was way too difficult (it required to much code on the user's behalf).
Hence I decided to try write a new client that would support this usage much better and encourage better HTTP client usage in general. Another goal of this new client is to ultimately replace all other clients currently in Zn (these different client are creating some confusion among users).
ZnNeoClient (a temporary name, to be renamed to ZnClient in the future) is a single object with a lot of (convenience) API to build, execute and process HTTP client requests. It is somewhat similar to Gofer like classes. It is also somewhat comparable to ZnHttpClient but it contains even more functionality.
The new tests in ZnNeoClientTests show some of the ways the client can be used. In the current Zn version all ZnClient class functionality as well as all ZnHTTPSocketFacade (and thus HTTPSocket and thus the rest of the image) has already been reimplemented using ZnNeoClient. These are good examples to look at.
At one point I plan to write some proper documentation, when the design settles down a bit, but here are some examples:
The simplest possible usage:
ZnNeoClient new get: 'http://zn.stxfx.eu/zn/small.html'.
This is shorthand for:
ZnNeoClient new
url: 'http://zn.stxfx.eu/zn/small.html';
get.
Which is actually shorthand for:
ZnNeoClient new
url: 'http://zn.stxfx.eu/zn/small.html';
get;
contents.
If you know upfront that you will do only one request, you can help conserve resources by doing:
ZnNeoClient new
beOneShot;
get: 'http://zn.stxfx.eu/zn/small.html'.
Connections are kept open whenever possible unless #beOneShot is chosen. Multiple requests (possibly to the same host) can be issued using the same client instance. At the end, #close should be send to the client, but garbage collection cleans up as well.
Specifying URLs as strings can sometimes be tricky when special characters such as spaces are involved, for this ZnNeoClient has a whole URL and request construction API. Here is an example:
ZnNeoClient new
http;
host: 'www.google.com';
addPath: 'search';
queryAt: 'q' put: 'Pharo Smalltalk';
get.
There is also API for specifying headers, forms, multipart uploads and so on. See the unit tests, the ZnClient class side as well as the ZnHTTPSocketFacade for examples.
The result of an HTTP request is an HTTP response, modelled by ZnResponse. Hence, you can ask a client for the last #response, #entity, #contents or test for #isSuccess.
Which brings us to the problem that it is not easy to properly set up and handle the various things that can go wrong. It is here that ZnNeoClient aims to make a big contribution.
Assume the following example: at some URL there is a list of numbers as lines in a text file that we want to download and use. Let's start simple:
^ ZnNeoClient new
get: 'http://www.example.com/numbers.txt'.
When all is well, this will return the text file as string. Let's add parsing:
^ ZnNeoClient new
contentReader: [ :entity |
(entity contents lines do: [ :each |
Integer readFrom: each ifFail: [ nil ] ])
select: [ :each | each notNil ] ];
get: 'http://www.example.com/numbers.txt'.
This will make sure we get a (possibly empty) list of numbers. The problem is, when number.txt is not found by the server, we don't deal properly with that situation. We can fix that:
^ ZnNeoClient new
enforceHttpSuccess: true;
contentReader: [ :entity |
(entity contents lines do: [ :each |
Integer readFrom: each ifFail: [ nil ] ])
select: [ :each | each notNil ] ];
get: 'http://www.example.com/numbers.txt'.
Now, a non-success code will throw an error. We should also make sure that we do get a text/plain document back, and we want a uniform error handler reaction:
^ ZnNeoClient new
enforceHttpSuccess: true;
enforceAcceptContentType: true;
accept: ZnMimeType textPlain;
contentReader: [ :entity |
(entity contents lines do: [ :each |
Integer readFrom: each ifFail: [ nil ] ])
select: [ :each | each notNil ] ];
ifFail: [ :exception |
self log: exception printString, ' while fetching numbers'.
^ #() ];
get: 'http://www.example.com/numbers.txt'.
The failBlock will be execute on any exception, including ZnHttpUnsuccessful and ZnUnexpectedContentType.
What about unreliable networking in general: we need a timeout, but better still, we could retry the request once or twice to cover for (possibly transient) networking/server problems.
^ ZnNeoClient new
timeout: 15;
numberOfRetries: 1;
retryDelay: 2;
enforceHttpSuccess: true;
enforceAcceptContentType: true;
accept: ZnMimeType textPlain;
contentReader: [ :entity |
(entity contents lines do: [ :each |
Integer readFrom: each ifFail: [ nil ] ])
select: [ :each | each notNil ] ];
ifFail: [ :exception |
self log: exception printString, ' while fetching numbers'.
^ #() ];
get: 'http://www.example.com/numbers.txt'.
If anything goes wrong, there will be one retry after a delay of 2 seconds.
Although there are sensible defaults for all options, it will probably make sense to group the options, like this:
^ ZnNeoClient new
systemPolicy;
accept: ZnMimeType textPlain;
contentReader: [ :entity |
(entity contents lines do: [ :each |
Integer readFrom: each ifFail: [ nil ] ])
select: [ :each | each notNil ] ];
ifFail: [ :exception |
self log: exception printString, ' while fetching numbers'.
^ #() ];
get: 'http://www.example.com/numbers.txt'.
Finding the proper defaults and policies will take some trial and error. Another strategy is factory method like ZnClient class>>#client or ZnHTTPSocketFacade class>>#client.
Here is another real-world example, invoking a REST service that returns JSON (you need the JSJsonParser class that comes with Seaside):
^ ZnNeoClient new
systemPolicy;
beOneShot;
url: 'http://easy.t3-platform.net/rest/geo-ip';
queryAt: 'address' put: '81.83.7.35';
accept: ZnMimeType applicationJson;
contentReader: [ :entity |
(JSJsonParser parse: entity contents) at: #country ];
ifFail: [ nil ];
get.
Or as a utility method:
XYZUtils class>>#countryForIpAddress: ipAddressString ifFail: failBlock
^ ZnNeoClient new
systemPolicy;
beOneShot;
url: 'http://easy.t3-platform.net/rest/geo-ip';
queryAt: 'address' put: ipAddressString;
accept: ZnMimeType applicationJson;
contentReader: [ :entity |
(JSJsonParser parse: entity contents) at: #country ];
ifFail: failBlock;
get
That's it for now. There is still some implementation and testing work to be done. As always, all feedback is welcome.
Sven
Sept. 4, 2011
Re: [Pharo-project] Zinc crashing image at start up
by Sven Van Caekenberghe
Lukas,
On 04 Sep 2011, at 18:17, Lukas Renggli wrote:
> There seems to be a new problem with Zinc when building Seaside. Not sure what it is:
Strange indeed. I just downloaded the lastest base seaside3 image from http://jenkins.lukas-renggli.ch and executed the builder/scripts/seaside3-zinc.st code manually and the server started and worked as expected.
The PrimitiveFailed seems to be in (server) Socket>>#waitForAcceptFor: but nothing was changed in the code calling that, or in surrounding error handlers.
I am correct to assume that the crash is while starting the server ? Or is it later during the save image ?
Sven
Sept. 4, 2011
Re: [Pharo-project] about Shout default to shout any text?
by Alain Plantec
Hi all,
just coming back ...
yes
if "not styled" is the default then #okToStyle should
return false if #shoutAboutToStyle is not implemented by the model:
> (model respondsTo: #shoutAboutToStyle:)
> ifFalse: [^true].
should be:
> (model respondsTo: #shoutAboutToStyle:)
> ifFalse: [^false].
Cheers
Alain
On 04/09/2011 14:25, Stéphane Ducasse wrote:
>>>
>>>
>>> The inspector is shouted because the "not to shout" was the default behavior
>>> of Shout, but now,
>>> okToStyle
>>> self shoutEnabled
>>> ifFalse: [^ false].
>>> (model respondsTo: #shoutAboutToStyle:)
>>> ifFalse: [^true].
>>> ^model shoutAboutToStyle: self
>>> the bold part make the default behavior "to shout".
>>> So maybe this value should be changed. But let's wait for Alain explanation
>>
>> No, #shoutEnabled returning true makes it enabled.
>
> I do not get it
>
>
> okToStyle
> self shoutEnabled
> ifFalse: [^ false].
> (model respondsTo: #shoutAboutToStyle:)
> ifFalse: [^true].
> ^model shoutAboutToStyle: self
>
> shoutEnabled
> ^ self class shoutEnabled
>
> shoutEnabled
> ^ (Smalltalk globals includesKey: #SHPreferences)
> and: [(Smalltalk globals at: #SHPreferences) enabled]
>
> so when shout is loaded self shoutEnabled = true
>
> self shoutEnabled
> ifFalse: [^ false].
>
> So okToStyle will return true when the method shoutAboutToStyle: is not defined
>
> (model respondsTo: #shoutAboutToStyle:)
> ifFalse: [^true].
>
> and this is this default that I'm talking about.
> Because if we would return false then only places that specifically define shoutAboutToStyle would be styled.
>
> No?
>
>
> Stef
>
Sept. 4, 2011
Re: [Pharo-project] Zinc crashing image at start up
by Lukas Renggli
Hi Sven,
There seems to be a new problem with Zinc when building Seaside. Not
sure what it is:
+ build.sh -i seaside3 -s seaside3-zinc -o seaside3-zinc
build.sh: Execution aborted (/usr/local/bin/cog)
THERE_BE_DRAGONS_HERE
PrimitiveFailed: primitive #signal in a Semaphore() failed
4 September 2011 5:53:45 pm
VM: unix - i686 - linux-gnu - Croquet Closure Cog VM [CoInterpreter
VMMaker-oscog.35]
Image: Pharo1.3 [Latest update: #13298]
Semaphore(Object)>>primitiveFailed:
Receiver: a Semaphore()
Arguments and temporary variables:
selector: #signal
Receiver's instance variables:
firstLink: nil
lastLink: nil
excessSignals: 1073741823
Semaphore(Object)>>primitiveFailed
Receiver: a Semaphore()
Arguments and temporary variables:
Receiver's instance variables:
firstLink: nil
lastLink: nil
excessSignals: 1073741823
Semaphore>>signal
Receiver: a Semaphore()
Arguments and temporary variables:
Receiver's instance variables:
firstLink: nil
lastLink: nil
excessSignals: 1073741823
[FinishedDelay := self.
TimingSemaphore signal] in DelayWaitTimeout(Delay)>>unschedule
Receiver: a DelayWaitTimeout(282210 msecs)
Arguments and temporary variables:
Receiver's instance variables:
delayDuration: 282210
resumptionTime: nil
delaySemaphore: a Semaphore()
beingWaitedOn: false
process: a Process in nil
expired: true
[caught := true.
self wait.
blockValue := mutuallyExcludedBlock value] in Semaphore>>critical:
Receiver: a Semaphore()
Arguments and temporary variables:
<<error during printing>
Receiver's instance variables:
firstLink: nil
lastLink: nil
excessSignals: 0
BlockClosure>>ensure:
Receiver: [caught := true.
self wait.
blockValue := mutuallyExcludedBlock value]
Arguments and temporary variables:
aBlock: [caught
ifTrue: [self signal]]
complete: nil
returnValue: nil
Receiver's instance variables:
outerContext: Semaphore>>critical:
startpc: 42
numArgs: 0
Semaphore>>critical:
Receiver: a Semaphore()
Arguments and temporary variables:
<<error during printing>
Receiver's instance variables:
firstLink: nil
lastLink: nil
excessSignals: 0
DelayWaitTimeout(Delay)>>unschedule
Receiver: a DelayWaitTimeout(282210 msecs)
Arguments and temporary variables:
Receiver's instance variables:
delayDuration: 282210
resumptionTime: nil
delaySemaphore: a Semaphore()
beingWaitedOn: false
process: a Process in nil
expired: true
[self unschedule] in DelayWaitTimeout>>wait
Receiver: a DelayWaitTimeout(282210 msecs)
Arguments and temporary variables:
Receiver's instance variables:
delayDuration: 282210
resumptionTime: nil
delaySemaphore: a Semaphore()
beingWaitedOn: false
process: a Process in nil
expired: true
BlockClosure>>ensure:
Receiver: [self schedule.
beingWaitedOn
ifTrue: [delaySemaphore wait]
ifFalse: [expired := true...etc...
Arguments and temporary variables:
aBlock: [self unschedule]
complete: true
returnValue: true
Receiver's instance variables:
outerContext: DelayWaitTimeout>>wait
startpc: 41
numArgs: 0
DelayWaitTimeout>>wait
Receiver: a DelayWaitTimeout(282210 msecs)
Arguments and temporary variables:
Receiver's instance variables:
delayDuration: 282210
resumptionTime: nil
delaySemaphore: a Semaphore()
beingWaitedOn: false
process: a Process in nil
expired: true
Semaphore>>waitTimeoutMSecs:
Receiver: a Semaphore()
Arguments and temporary variables:
anInteger: 282210
d: a DelayWaitTimeout(282210 msecs)
Receiver's instance variables:
firstLink: nil
lastLink: nil
excessSignals: 0
Socket>>waitForConnectionFor:ifTimedOut:
Receiver: a Socket[waitingForConnection]
Arguments and temporary variables:
timeout: 300
timeoutBlock: [^ nil]
startTime: 3617674
msecsDelta: 300000
msecsEllapsed: 17790
status: 1
Receiver's instance variables:
semaphore: a Semaphore()
socketHandle: #[230 40 102 78 0 0 0 0 64 77 219 8]
readSemaphore: a Semaphore()
writeSemaphore: a Semaphore()
Socket>>waitForAcceptFor:
Receiver: a Socket[waitingForConnection]
Arguments and temporary variables:
timeout: 300
Receiver's instance variables:
semaphore: a Semaphore()
socketHandle: #[230 40 102 78 0 0 0 0 64 77 219 8]
readSemaphore: a Semaphore()
writeSemaphore: a Semaphore()
ZnMultiThreadedServer>>serveConnectionsOn:
Receiver: a ZnMultiThreadedServer(stopped 8080)
Arguments and temporary variables:
listeningSocket: a Socket[waitingForConnection]
stream: nil
socket: nil
Receiver's instance variables:
port: 8080
process: nil
serverSocket: a Socket[waitingForConnection]
delegate: a ZnSeasideServerAdaptorDelegate
authenticator: nil
log: a ZnLogSupport
lastRequest: nil
lastResponse: nil
lock: a Mutex
connections: an OrderedCollection()
[[serverSocket isValid
ifFalse: [^ self listenLoop].
self serveConnectionsOn: serverSocket] repeat.
nil] in ZnMultiThreadedServer>>listenLoop
Receiver: a ZnMultiThreadedServer(stopped 8080)
Arguments and temporary variables:
Receiver's instance variables:
port: 8080
process: nil
serverSocket: a Socket[waitingForConnection]
delegate: a ZnSeasideServerAdaptorDelegate
authenticator: nil
log: a ZnLogSupport
lastRequest: nil
lastResponse: nil
lock: a Mutex
connections: an OrderedCollection()
BlockClosure>>ifCurtailed:
Receiver: [[serverSocket isValid
ifFalse: [^ self listenLoop].
self serveConnectionsOn: serverSoc...etc...
Arguments and temporary variables:
aBlock: [self releaseServerSocket]
complete: nil
result: nil
Receiver's instance variables:
outerContext: ZnMultiThreadedServer>>listenLoop
startpc: 52
numArgs: 0
ZnMultiThreadedServer>>listenLoop
Receiver: a ZnMultiThreadedServer(stopped 8080)
Arguments and temporary variables:
Receiver's instance variables:
port: 8080
process: nil
serverSocket: a Socket[waitingForConnection]
delegate: a ZnSeasideServerAdaptorDelegate
authenticator: nil
log: a ZnLogSupport
lastRequest: nil
lastResponse: nil
lock: a Mutex
connections: an OrderedCollection()
[[self listenLoop] repeat.
nil] in ZnMultiThreadedServer(ZnSingleThreadedServer)>>start
Receiver: a ZnMultiThreadedServer(stopped 8080)
Arguments and temporary variables:
Receiver's instance variables:
port: 8080
process: nil
serverSocket: a Socket[waitingForConnection]
delegate: a ZnSeasideServerAdaptorDelegate
authenticator: nil
log: a ZnLogSupport
lastRequest: nil
lastResponse: nil
lock: a Mutex
connections: an OrderedCollection()
[self value.
Processor terminateActive] in BlockClosure>>newProcess
Receiver: [[self listenLoop] repeat.
nil]
Arguments and temporary variables:
Receiver's instance variables:
outerContext: ZnMultiThreadedServer(ZnSingleThreadedServer)>>start
startpc: 77
numArgs: 0
--- The full stack ---
Semaphore(Object)>>primitiveFailed:
Semaphore(Object)>>primitiveFailed
Semaphore>>signal
[FinishedDelay := self.
TimingSemaphore signal] in DelayWaitTimeout(Delay)>>unschedule
[caught := true.
self wait.
blockValue := mutuallyExcludedBlock value] in Semaphore>>critical:
BlockClosure>>ensure:
Semaphore>>critical:
DelayWaitTimeout(Delay)>>unschedule
[self unschedule] in DelayWaitTimeout>>wait
BlockClosure>>ensure:
DelayWaitTimeout>>wait
Semaphore>>waitTimeoutMSecs:
Socket>>waitForConnectionFor:ifTimedOut:
Socket>>waitForAcceptFor:
ZnMultiThreadedServer>>serveConnectionsOn:
[[serverSocket isValid
ifFalse: [^ self listenLoop].
self serveConnectionsOn: serverSocket] repeat.
nil] in ZnMultiThreadedServer>>listenLoop
BlockClosure>>ifCurtailed:
ZnMultiThreadedServer>>listenLoop
[[self listenLoop] repeat.
nil] in ZnMultiThreadedServer(ZnSingleThreadedServer)>>start
[self value.
Processor terminateActive] in BlockClosure>>newProcess
------------------------------------------------------------
Processes and their stacks:
Process: a Process in Process>>resume
stack:
Process>>resume
BlockClosure>>forkAt:named:
ZnMultiThreadedServer(ZnSingleThreadedServer)>>start
ZnZincServerAdaptor>>basicStart
[aServerAdaptor basicStart] in WAServerManager>>start:
BlockClosure>>ifCurtailed:
WAServerManager>>start:
ZnZincServerAdaptor(WAServerAdaptor)>>start
UndefinedObject>>DoIt
Compiler>>evaluate:in:to:notifying:ifFail:logged:
Compiler class>>evaluate:for:notifying:logged:
Compiler class>>evaluate:for:logged:
Compiler class>>evaluate:logged:
[| chunk | val := (self peekFor: $!)
ifTrue: [(Compiler evaluate: self nextChunk logged: false)
scanFrom: self]
ifFalse: [chunk := self nextChunk.
self checkForPreamble: chunk.
Compiler evaluate: chunk logged: true]] in [:bar |
[self atEnd]
whileFalse: [bar value: self position.
self skipSeparators.
[| chunk | val := (self peekFor: $!)
ifTrue: [(Compiler evaluate: self nextChunk logged: false)
scanFrom: self]
ifFalse: [chunk := self nextChunk.
self checkForPreamble: chunk.
Compiler evaluate: chunk logged: true]]
on: InMidstOfFileinNotification
do: [:ex | ex resume: true].
self skipStyleChunk].
self close] in RWBinaryOrTextStream(PositionableStream)>>fileInAnnouncing:
BlockClosure>>on:do:
[:bar |
[self atEnd]
whileFalse: [bar value: self position.
self skipSeparators.
[| chunk | val := (self peekFor: $!)
ifTrue: [(Compiler evaluate: self nextChunk logged: false)
scanFrom: self]
ifFalse: [chunk := self nextChunk.
self checkForPreamble: chunk.
Compiler evaluate: chunk logged: true]]
on: InMidstOfFileinNotification
do: [:ex | ex resume: true].
self skipStyleChunk].
self close] in RWBinaryOrTextStream(PositionableStream)>>fileInAnnouncing:
NonInteractiveUIManager>>progressInitiationExceptionDefaultAction:
ProgressInitiationException>>defaultAction
UndefinedObject>>handleSignal:
ProgressInitiationException(Exception)>>signal
------------------------------
Process: a Process in Delay class>>handleTimerEvent
stack:
Delay class>>handleTimerEvent
Delay class>>runTimerEventLoop
[self runTimerEventLoop] in Delay class>>startTimerEventLoop
[self value.
Processor terminateActive] in BlockClosure>>newProcess
------------------------------
Process: a Process in SmalltalkImage>>lowSpaceWatcher
stack:
SmalltalkImage>>lowSpaceWatcher
[self lowSpaceWatcher] in SmalltalkImage>>installLowSpaceWatcher
[self value.
Processor terminateActive] in BlockClosure>>newProcess
------------------------------
Process: a Process in ProcessorScheduler class>>idleProcess
stack:
ProcessorScheduler class>>idleProcess
[self idleProcess] in ProcessorScheduler class>>startUp
[self value.
Processor terminateActive] in BlockClosure>>newProcess
------------------------------
Process: a Process in [delaySemaphore wait] in Delay>>wait
stack:
[delaySemaphore wait] in Delay>>wait
BlockClosure>>ifCurtailed:
Delay>>wait
InputEventPollingFetcher>>waitForInput
InputEventPollingFetcher(InputEventFetcher)>>eventLoop
[self eventLoop] in
InputEventPollingFetcher(InputEventFetcher)>>installEventLoop
[self value.
Processor terminateActive] in BlockClosure>>newProcess
------------------------------
Process: a Process in WeakArray class>>finalizationProcess
stack:
WeakArray class>>finalizationProcess
[self finalizationProcess] in WeakArray class>>restartFinalizationProcess
[self value.
Processor terminateActive] in BlockClosure>>newProcess
------------------------------
Process: a Process in [delaySemaphore wait] in Delay>>wait
stack:
[delaySemaphore wait] in Delay>>wait
BlockClosure>>ifCurtailed:
Delay>>wait
GRPharoPlatform>>cometWait
CTPusher class>>pingProcess
[[self pingProcess] repeat.
nil] in CTPusher class>>startUp
[self value.
Processor terminateActive] in BlockClosure>>newProcess
------------------------------
Process: a Process in nil
stack:
Array(SequenceableCollection)>>do:
[:logger |
logger nextPutAll: 'Processes and their stacks: ';
cr.
Process allInstances
do: [:each |
| ctx |
logger nextPutAll: 'Process: ';
print: each;
cr;
nextPutAll: ' stack:';
cr;
cr.
ctx := each isActiveProcess
ifTrue: [thisContext sender]
ifFalse: [each suspendedContext].
ctx
ifNotNil: [(ctx stackOfSize: 20)
do: [:s | logger print: s;
cr]].
logger nextPutAll: '------------------------------';
cr;
cr]] in [Smalltalk logError: aString inContext: aContext.
Smalltalk
logDuring: [:logger |
logger nextPutAll: 'Processes and their stacks: ';
cr.
Process allInstances
do: [:each |
| ctx |
logger nextPutAll: 'Process: ';
print: each;
cr;
nextPutAll: ' stack:';
cr;
cr.
ctx := each isActiveProcess
ifTrue: [thisContext sender]
ifFalse: [each suspendedContext].
ctx
ifNotNil: [(ctx stackOfSize: 20)
do: [:s | logger print: s;
cr]].
logger nextPutAll: '------------------------------';
cr;
cr]]] in NonInteractiveUIManager>>quitFrom:withMessage:
[logStream := self openLog.
aMonadicBlock value: logStream] in SmalltalkImage>>logDuring:
BlockClosure>>ensure:
SmalltalkImage>>logDuring:
[Smalltalk logError: aString inContext: aContext.
Smalltalk
logDuring: [:logger |
logger nextPutAll: 'Processes and their stacks: ';
cr.
Process allInstances
do: [:each |
| ctx |
logger nextPutAll: 'Process: ';
print: each;
cr;
nextPutAll: ' stack:';
cr;
cr.
ctx := each isActiveProcess
ifTrue: [thisContext sender]
ifFalse: [each suspendedContext].
ctx
ifNotNil: [(ctx stackOfSize: 20)
do: [:s | logger print: s;
cr]].
logger nextPutAll: '------------------------------';
cr;
cr]]] in NonInteractiveUIManager>>quitFrom:withMessage:
BlockClosure>>ensure:
NonInteractiveUIManager>>quitFrom:withMessage:
NonInteractiveUIManager>>unhandledErrorDefaultAction:
UnhandledError>>defaultAction
UndefinedObject>>handleSignal:
UnhandledError(Exception)>>signal
UnhandledError class>>signalForException:
PrimitiveFailed(Error)>>defaultAction
UndefinedObject>>handleSignal:
PrimitiveFailed(Exception)>>signal
PrimitiveFailed class(SelectorException class)>>signalFor:
Semaphore(Object)>>primitiveFailed:
Semaphore(Object)>>primitiveFailed
Semaphore>>signal
------------------------------
/srv/jenkins/builder/build.sh: line 170: 4882 Killed
exec "$PHARO_VM" $PHARO_PARAM "$OUTPUT_IMAGE" "$OUTPUT_SCRIPT"
Build step 'Execute shell' marked build as failure
[CHECKSTYLE] Skipping publisher since build result is FAILURE
Archiving artifacts
Recording test results
Finished: FAILURE
On 4 September 2011 16:33, Lukas Renggli <renggli(a)gmail.com> wrote:
>> Yeah, the idea of the weak data structure was to have a fallback to the current situation in case something went wrong when explicitely managing the connections. The current implementation now uses a normal ordered collection. It passes all tests.
>
> Sounds great!
>
>> Note that this version of Zn is way further than what is in 1.3, it also contains a brand new client I am working on and some important code already uses this new client. This needs some more testing before it can be included I guess (although it works for me). I know the Seaside builds use the latest Zn.
>
> Yes, I update Zn for the Seaside build to the latest version.
>
> Lukas
>
> --
> Lukas Renggli
> www.lukas-renggli.ch
>
--
Lukas Renggli
www.lukas-renggli.ch
Sept. 4, 2011
Re: [Pharo-project] Zinc crashing image at start up
by Lukas Renggli
> Yeah, the idea of the weak data structure was to have a fallback to the current situation in case something went wrong when explicitely managing the connections. The current implementation now uses a normal ordered collection. It passes all tests.
Sounds great!
> Note that this version of Zn is way further than what is in 1.3, it also contains a brand new client I am working on and some important code already uses this new client. This needs some more testing before it can be included I guess (although it works for me). I know the Seaside builds use the latest Zn.
Yes, I update Zn for the Seaside build to the latest version.
Lukas
--
Lukas Renggli
www.lukas-renggli.ch
Sept. 4, 2011
Re: [Pharo-project] Zinc crashing image at start up
by Sven Van Caekenberghe
On 02 Sep 2011, at 23:01, Lukas Renggli wrote:
>> It would be better if this were prevented. I will have a look to see if I can keep track of these connections and worker processes in a weak data structure so that they can be managed better.
>
> Better no weak data structures. The listener process could more
> efficiently cleanup unused workers, no?
Yeah, the idea of the weak data structure was to have a fallback to the current situation in case something went wrong when explicitely managing the connections. The current implementation now uses a normal ordered collection. It passes all tests.
Note that this version of Zn is way further than what is in 1.3, it also contains a brand new client I am working on and some important code already uses this new client. This needs some more testing before it can be included I guess (although it works for me). I know the Seaside builds use the latest Zn.
Igor, as far as I could see, I only got nice PrimitiveFailed's.
Sven
A new version of Zinc-HTTP was added to project Zinc HTTP Components:
http://www.squeaksource.com/ZincHTTPComponents/Zinc-HTTP-SvenVanCaekenbergh…
==================== Summary ====================
Name: Zinc-HTTP-SvenVanCaekenberghe.189
Author: SvenVanCaekenberghe
Time: 4 September 2011, 3:20:15 pm
UUID: b4f2d979-0097-4dc8-bde9-23edda15a3f9
Ancestors: Zinc-HTTP-SvenVanCaekenberghe.188
Added some new internal functionality to ZnMultiThreadedServer:
To keep track of all its open client connections (socket streams) (#socketStreamOn: and #closeSocketStream) so that they can all be force closed (#closeAllConnections) when the server stops (#stop). This is necessary because on image save the worker processes and socket streams are frozen and fail when they start up afterwards due to illegal socket handles.
Note that #readRequestSafely: was extended and #writeResponseSafely:on: was introduced to handle several exceptions, most notably PrimitiveFailed, in the situation where a socket stream is force closed on a live process using that stream. This can be observed in #testTimeout.
The timeouts on reading/writing socket streams take care of closing connections that are kept open too long. Maybe the server side timeouts should be even shorter to conserve resources.
Sept. 4, 2011
Re: [Pharo-project] Testing Pharo OneClick 1.3
by Sven Van Caekenberghe
On 03 Sep 2011, at 18:54, Hernán Morales Durand wrote:
> 2011/9/2 Stéphane Ducasse <stephane.ducasse(a)inria.fr>:
>>
>> On Sep 2, 2011, at 7:16 AM, Hernán Morales Durand wrote:
>>
>>> Two more:
>>>
>>> ScriptLoader new installingInstaller
>>
>> should not work and should not be used.
>>
>> Nobody should use ScriptLoader :)
>>
>
> I know :) just pointing a way to reproduce a possible problem with Zinc.
This can very easily be fixed:
http://lists.gforge.inria.fr/pipermail/pharo-project/2011-August/052316.html
Read the rest of the thread to understand that this is also a discussion about API and expected (default) behavior.
Sven
Sept. 4, 2011
Re: [Pharo-project] about Shout default to shout any text?
by Lukas Renggli
>>> which shout the text if the model do not know #shoutAboutToStyle:
>>
>> No. The interaction is different:
>>
>> 1. TextMorph changes its contents.
>> 2. TextMorph notifies its styler withe the morph and its model that
>> there might be the need to style.
>> 3. The styles does whatever it wants to do:
>> Â - The null styler might ignore the request.
>> Â - The ShoutStyler calls #shoutAboutToStyle: on the model to ask if
>> and how to style (earlier versions also called #okToStyle before they
>> called #shoutAboutToStyle:).
>> Â - The ShoutStyler might also decide to auto format the text. I
>> believe earlier versions of Shout could do that.
>
> Ok I have no idea how it was before and we never touched Shout.
> So I will wait for alain because I'm more and more confused.
In other words, this is a double-dispatch where the type of the styler
is revealed on the model. In case of Shout #shoutAboutToStyle: tells
the model that Shout is ready to take further commands on how to style
the input. This gives true extensibility and is also very efficient.
Lukas
--
Lukas Renggli
www.lukas-renggli.ch
Sept. 4, 2011
Re: [Pharo-project] about Shout default to shout any text?
by Stéphane Ducasse
On Sep 4, 2011, at 2:34 PM, Lukas Renggli wrote:
>>> No, #shoutEnabled returning true makes it enabled.
>>
>> shoutEnabled return true if Shout classes are installed in the system.
>
> This is a bug then.
>
> #okToStyle should never be called when Shout is not installed.
>
> #shoutEnabled returns true, if the model might request highlighting. I
> suggested Alain to remove it, I don't think it was ever used.
>
>> (model respondsTo: #shoutAboutToStyle:)
>> ifFalse: [^true].
>>
>> which shout the text if the model do not know #shoutAboutToStyle:
>
> No. The interaction is different:
>
> 1. TextMorph changes its contents.
> 2. TextMorph notifies its styler withe the morph and its model that
> there might be the need to style.
> 3. The styles does whatever it wants to do:
> - The null styler might ignore the request.
> - The ShoutStyler calls #shoutAboutToStyle: on the model to ask if
> and how to style (earlier versions also called #okToStyle before they
> called #shoutAboutToStyle:).
> - The ShoutStyler might also decide to auto format the text. I
> believe earlier versions of Shout could do that.
Ok I have no idea how it was before and we never touched Shout.
So I will wait for alain because I'm more and more confused.
Stef
> Lukas
>
> --
> Lukas Renggli
> www.lukas-renggli.ch
>
Sept. 4, 2011