Re: [Jolie-devel] OneWay messages
A service-oriented programming language.
Brought to you by:
fmontesi
From: Matthias D. W. <mwa...@ya...> - 2013-11-21 17:19:48
|
Hi Fabrizio, yes, the easiest would be to extend ChannelClosedException from EOFException? So very little changes would be necessary. Otherwise we would need to extend each method's signature. Cheers, Matthias Fabrizio Montesi schrieb: > Hi Matthias, > yeah, we have an annoying bug that doesn't really hurt but appears > like that (just prints that on screen) depending on the underlying OS > and network. It is consistent when using localhost afaik. > > Basically, every output port channel is handled by a separate thread, > that jolie.net.AbstractCommChannel$ResponseReceiver, which waits for > new messages on the channel and puts them in cache when the > interpreter is ready to receive a response for an operation (in the > case of one-way such responses are just ACKs that the messages have > been put in the channel cache on the other side). > > So, you have that thread on the client waiting on the channel, and the > server suddenly goes down because it terminates execution. Then, the > client throws that exception. > > The problem in handling this gracefully is that we should > differentiate between an EOFException that we get in the middle of > parsing a received message in a protocol (e.g., SODEP, but more in > general CommProtocol.recv()), or the same exception got when trying to > receive the first bit of information (which is your case if you look > at the source code at SodepProtocol.java:252). > Then, the protocol could throw a custom exception that we create > (ChannelClosedException?) representing a graceful channel closing and > catch it from jolie.net.AbstractCommChannel$ResponseReceiver. > > Let me know if you'd be interested in tackling this. > > Cheers, > Fabrizio. > > On Thu, Nov 21, 2013 at 11:53 AM, Matthias Dieter Wallnöfer > <mwa...@ya...> wrote: >> Hi Fabrizio, >> >> this works well, but on the client side >>> main >>> { >>> twice@TwiceService( 5 ) >>> } >> I get a Java EOF exception. I imagine that this could be a coordination >> issue? >>> Nov 21, 2013 11:49:30 AM jolie.Interpreter logWarning >>> WARNING: [client.ol] java.io.EOFException >>> at java.io.DataInputStream.readFully(DataInputStream.java:197) >>> at java.io.DataInputStream.readLong(DataInputStream.java:416) >>> at jolie.net.SodepProtocol.readMessage(SodepProtocol.java:252) >>> at jolie.net.SodepProtocol.recv(SodepProtocol.java:305) >>> at jolie.net.SocketCommChannel.recvImpl(SocketCommChannel.java:92) >>> at jolie.net.CommChannel.recv(CommChannel.java:198) >>> at >>> jolie.net.AbstractCommChannel$ResponseReceiver.run(AbstractCommChannel.java:226) >>> at >>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) >>> at >>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) >>> at java.lang.Thread.run(Thread.java:724) >> Cheers, >> Matthias >> >> Fabrizio Montesi schrieb: >> >>> Hi Matthias, >>> this: >>>> twice( number ) { >>>> result = number * 2; >>>> println@Console( result )(); >>>> } >>> is not a construct in the language. Request-Response operations >>> support the { block } construct because it is useful to specify >>> something to happen *in-between* the request and the response. For >>> one-ways this is not necessary because they just receive something. >>> Hence you can just use the semicolon operator for expressing a >>> sequence and obtain what you want: >>> >>> twice( number ); >>> result = number * 2; >>> println@Console( result )() >>> >>> >>> Cheers, >>> Fabrizio. >>> >>> >>> On Thu, Nov 21, 2013 at 11:04 AM, Matthias Dieter Wallnöfer >>> <mwa...@ya...> wrote: >>>> Hi developers, >>>> >>>> I got another question: in >>>> >>>> http://www.jolie-lang.org/?top_menu=documentation&sideMenuAction=getting_started/behavior_and_deployment >>>> we have a simple client-server example: >>>>> |main| >>>>> |{| >>>>> |||twice( number )( response ) {| >>>>> |||response = number * ||2| >>>>> |||}| >>>>> |}| >>>> But when I change it to be one-way I run into trouble: >>>>> interface TwiceInterface { >>>>> OneWay: twice( int ) >>>>> } >>>> and >>>>> main >>>>> { >>>>> twice( number ) { >>>>> result = number * 2; >>>>> println@Console( result )(); >>>>> } >>>>> } >>>> does not work. Why? >>>> >>>> Do I need something like this? >>>>> main >>>>> { >>>>> [ twice( number ) ] { >>>>> result = number * 2; >>>>> println@Console( result )(); >>>>> } >>>>> } >>>> Cheers, >>>> Matthias >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Shape the Mobile Experience: Free Subscription >>>> Software experts and developers: Be at the forefront of tech innovation. >>>> Intel(R) Software Adrenaline delivers strategic insight and game-changing >>>> conversations that shape the rapidly evolving mobile landscape. Sign up >>>> now. >>>> >>>> http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk >>>> _______________________________________________ >>>> Jolie-devel mailing list >>>> Jol...@li... >>>> https://lists.sourceforge.net/lists/listinfo/jolie-devel >> |