Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Shaggar
Apr 26, 2006

Solution: don't use unreliable links.

Adbot
ADBOT LOVES YOU

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Shaggar posted:

Solution: don't use unreliable links.

you first

MononcQc
May 29, 2007

Shaggar posted:

Solution: don't use unreliable links.

Next problem: timeouts. They leave you uncertain on whether the problem is (to name a few that can still happen with 'reliable' links):
  • the network (or some component) is saturated and you didn't get your failure response
  • the network (or some component) is saturated and you didn't get your success response
  • the other host is busy doing your task and you cannot know whether it will succeed or fail
  • the other host has failed for any reason (software, hardware) and it happened before it was done
  • the other host has failed for any reason (software, hardware) and it happened after it was done, but before it could send a response telling you it failed
  • the other host has failed for any reason (software, hardware) and it happened after it was done, but before it could send a response telling you it succeeded
  • there was an actual failure in network equipment and you didn't get your failure response
  • there was an actual failure in network equipment and you didn't get your success response
  • someone made a configuration error that ate your failure response
  • someone made a configuration error that ate your success response
  • the other endpoint is stuck or busy and hasn't processed your request yet (using a queue)
  • you got an actual answer back from the other side, but timed out before you had the time to process it
Hence, retrying following a timeout failure can take place under a single element of the following (or many of them if you retry multiple times):
  • You are retrying a call that actually failed (hooray!)
  • You are retrying a call that actually succeeded
  • You are retrying a call that is still running
  • You are retrying a call that has yet had the time to be executed and are making things worse

And each of them can fail in the same way as above. Moreover, what can fail is your 'rollback' RPC call, letting you unsure whether it did roll back or not.

This is disregarding bugs of any kind. If your application is in any way dealing with side-effects following any single decision made where the failure or success assumption was wrong, you may end up doing the equivalent of duplicating messages even over reliable links, negating a chunk of all that investment in hardware just to get more reliable links :toot:

So it turns out you need to actually think about your things and do things like have pre/post conditions, have idempotence, or other similar properties that you have to think of ahead of time for these things and not just assume they don't happen.

RPC is the p-lang of distributed systems.

MononcQc fucked around with this message at 18:56 on Jun 25, 2013

trex eaterofcadrs
Jun 17, 2005
My lack of understanding is only exceeded by my lack of concern.

MononcQc posted:

You are retrying a call that actually succeeded

my favorite

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

tef posted:

i know this is all a bit cjs but i've quit my captialist life and i'm gonna work for a non-proft and help teach kids to play and invent with code.

oh so you're gonna start postin in here full time

Shaggar
Apr 26, 2006

MononcQc posted:

Next problem: timeouts. They leave you uncertain on whether the problem is (to name a few that can still happen with 'reliable' links):
  • the network (or some component) is saturated and you didn't get your failure response
  • the network (or some component) is saturated and you didn't get your success response
  • the other host is busy doing your task and you cannot know whether it will succeed or fail
  • the other host has failed for any reason (software, hardware) and it happened before it was done
  • the other host has failed for any reason (software, hardware) and it happened after it was done, but before it could send a response telling you it failed
  • the other host has failed for any reason (software, hardware) and it happened after it was done, but before it could send a response telling you it succeeded
  • there was an actual failure in network equipment and you didn't get your failure response
  • there was an actual failure in network equipment and you didn't get your success response
  • someone made a configuration error that ate your failure response
  • someone made a configuration error that ate your success response
  • the other endpoint is stuck or busy and hasn't processed your request yet (using a queue)
  • you got an actual answer back from the other side, but timed out before you had the time to process it
Hence, retrying following a timeout failure can take place under a single element of the following (or many of them if you retry multiple times):
  • You are retrying a call that actually failed (hooray!)
  • You are retrying a call that actually succeeded
  • You are retrying a call that is still running
  • You are retrying a call that has yet had the time to be executed and are making things worse

And each of them can fail in the same way as above. Moreover, what can fail is your 'rollback' RPC call, letting you unsure whether it did roll back or not.

This is disregarding bugs of any kind. If your application is in any way dealing with side-effects following any single decision made where the failure or success assumption was wrong, you may end up doing the equivalent of duplicating messages even over reliable links, negating a chunk of all that investment in hardware just to get more reliable links :toot:

So it turns out you need to actually think about your things and do things like have pre/post conditions, have idempotence, or other similar properties that you have to think of ahead of time for these things and not just assume they don't happen.

RPC is the p-lang of distributed systems.

Wrong. The far end should accept the retry and return either the status if the new attempt if it previously failed or the status of the old attempt if it previously succeeded or failed permanently. Both sides are then reconciled and everyone is happy.

Rpc is fine and is not actually different than your overly complicated rpc-but-not-called-rpc systems.

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

MononcQc posted:

laying the cold hold truth

I actually implemented a monitoring/stress testing tool to help catch parts of our application that weren't idempotent. It handles and retries based on the type of errors it knows about. It's really hard to draw conclusions of where the problems occur, but it's fun stuff throwing 30,000 clients at our servers to see how they handle.

Nomnom Cookie
Aug 30, 2009



Condiv posted:

the sbt izpack plugin uses yaml as its config file. it takes this yaml file and converts it into xml which it hands to the izpack thing. i had my own xml config file for izpack but the plugin demands i make a yaml one so it can covert it into xml.

sbt is horrible andd the #1 reason i don't use scala more

Nomnom Cookie
Aug 30, 2009



your project definition is scala code! your project definition definition is also scala code! want to know how to do anything? use the source, luke!

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug
gradle seemed decent

Condiv
May 7, 2008

Sorry to undo the effort of paying a domestic abuser $10 to own this poster, but I am going to lose my dang mind if I keep seeing multiple posters who appear to be Baloogan.

With love,
a mod


Nomnom Cookie posted:

sbt is horrible andd the #1 reason i don't use scala more

nah, sbt is generally pretty nice. the documentation is much better nowadays.

Shaggar
Apr 26, 2006
Can you build scala w/ maven?

Condiv
May 7, 2008

Sorry to undo the effort of paying a domestic abuser $10 to own this poster, but I am going to lose my dang mind if I keep seeing multiple posters who appear to be Baloogan.

With love,
a mod


Shaggar posted:

Can you build scala w/ maven?

yeah, and we used to. sbt builds our code faster and is more flexible though, so we switched.

Shaggar
Apr 26, 2006
Sounds like you weren't using maven right.

Shaggar
Apr 26, 2006
"More flexible" aka "lets us do terrible hacks in the build"

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

Cocoa Crispies posted:

gradle seemed decent

i'm very intrigued by gradle; the people who wrote "continuous delivery" make it sound a bit like "maven plus"

MononcQc
May 29, 2007

Shaggar posted:

Wrong. The far end should accept the retry and return either the status if the new attempt if it previously failed or the status of the old attempt if it previously succeeded or failed permanently. Both sides are then reconciled and everyone is happy.

Rpc is fine and is not actually different than your overly complicated rpc-but-not-called-rpc systems.

This depends on how your RPC calls for transactions work and how many hosts are involved. What you suggest is safe only if:

- Your operations are side-effect free, outside of commit logs
- You have ACID distributed commits over the entire service-side
- You want the entire system to lock up when there is a part of the service that becomes unavailable to others (which is usually indistinguishable from high latency or a timeout)
- Keep your transaction/commit logs around for a relatively long time

Otherwise, you will have problems.

Side-effects in the operations of your RPC calls means a retry is not purely a retry and other entities may receive duplicated or unordered messages about events that happened. If you 'undo' the side-effects by sending a new one, you have to be aware that this 'undo' can fail in a similar way.

If you don't have ACID commits over the cluster for the service (or have more than one service node), a retry can land on a different node and run at the same time as the other one that was still running, with either of them not knowing that the other was done, breaking your "return the previous result" scheme.

This can be avoided if you make sure a client always contacts the same RPC endpoint, but unless you agree to have the system lock up, it means you may retry on another node when failing over and that you will break your scheme the same way. Also other clients on other nodes may call different RPC endpoints with similar operations and still break your assumptions.

If you garbage-collect your transaction logs from time to time (or compact them, or drop them to favor a snapshot of the system state), a prolonged delay or timeout (say your operation is stuck in a queue, or your Java servers locked up because of a leap second), the previous accepted value for that transaction can be lost or impossible to retrieve, leading to a duplicated effort.

Nevermind that your scheme basically reduces RPC to a database operation in some SQL store given what you need to make it safe for real.

Condiv
May 7, 2008

Sorry to undo the effort of paying a domestic abuser $10 to own this poster, but I am going to lose my dang mind if I keep seeing multiple posters who appear to be Baloogan.

With love,
a mod


Shaggar posted:

"More flexible" aka "lets us do terrible hacks in the build"

only if you consider any functionality not offered by maven a terrible hack.

which i'm sure you do.

b0lt
Apr 29, 2005

Shaggar posted:

"More flexible" aka "lets us do terrible hacks in the build"

can maven build x++?

MORE CURLY FRIES
Apr 8, 2004

tef posted:

i know this is all a bit cjs but i've quit my captialist life and i'm gonna work for a non-proft and help teach kids to play and invent with code.

code club is legit cool congrats

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Cocoa Crispies posted:

gradle seemed decent

gradle to the grave

Nomnom Cookie
Aug 30, 2009



is gradle any good for building c++? i'm using maven currently to build a bunch of java code + produce some assets tbz2s and we're adding c++. i can write some makefiles or whatever but i'd prefer to keep One Build to Rule Them All if i can

Zombywuf
Mar 29, 2008

Shaggar posted:

Solution: don't use unreliable links.

Solution: don't use Microsoft software.

Shaggar
Apr 26, 2006
Microsoft and java are the best.

Nomnom Cookie
Aug 30, 2009



tbf shaggar probably just has to deal with 1 app server + 1 db server so he doesn't need to worry about resilience

Shaggar
Apr 26, 2006
I have multiple servers but one db, but its mssql and not faddb so ur right I do t have to worry about failures.

Max Facetime
Apr 18, 2009

MononcQc posted:

This depends on how your RPC calls for transactions work and how many hosts are involved. What you suggest is safe only if:

- Your operations are side-effect free, outside of commit logs
- You have ACID distributed commits over the entire service-side
- You want the entire system to lock up when there is a part of the service that becomes unavailable to others (which is usually indistinguishable from high latency or a timeout)
- Keep your transaction/commit logs around for a relatively long time

Otherwise, you will have problems.

just have each RPC call return a CRDT with each partial success/failure state and the options available to the client at each forming a monotonic semilattice that converges to a failure state if the client doesn't keep retrying, ease peace

Nomnom Cookie
Aug 30, 2009



Max Facetime posted:

just have each RPC call return a CRDT with each partial success/failure state and the options available to the client at each forming a monotonic semilattice that converges to a failure state if the client doesn't keep retrying, ease peace

corba 3.1

Zombywuf
Mar 29, 2008

Max Facetime posted:

just have each RPC call return a CRDT with each partial success/failure state and the options available to the client at each forming a monotonic semilattice that converges to a failure state if the client doesn't keep retrying, ease peace

They would only form a semilattice if the operations were idempotent, not commutative.

ps. idempotence is the best. idempote every day

MononcQc
May 29, 2007

Max Facetime posted:

just have each RPC call return a CRDT with each partial success/failure state and the options available to the client at each forming a monotonic semilattice that converges to a failure state if the client doesn't keep retrying, ease peace

This is the super ideal "here's what you want to do and be rock solid" (that or idempotence if you want to keep retrying) but usually it just means being aware of things that may or may not fail, and designing around that (somewhat equivalent to not pushing out a git clone that believes merge conflicts will never happen for example), possibly reminding yourself that side-effects should be limited or maybe grouped together, and that if you can easily get idempotent operations, it might be decent to aim for that.

MononcQc
May 29, 2007

Beat the CAP theorem erryday by using infinite timeouts and never giving up on an operation, just believing it is very very late

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

MononcQc posted:

Beat the CAP theorem erryday by using infinite timeouts and never giving up on an operation, just believing it is very very late

The I2C library provided with the uC on my main project at work does this. You can probably imagine the results. (we eventually wrote our own for a variety of reasons, but this was the biggest)

Legitimate Pape
Sep 6, 2012

by T. Finninho

OBAMA BIN LinkedIn posted:

so basically anything that involves that involves things being related being related to other things

tef
May 30, 2004

-> some l-system crap ->

MononcQc posted:

rpc is p-lang

depends if you mean synchronous rpc, or async rpc using futures/callbacks/promises. i mean finagle is pretty neat :toot:

i mean syncrhonous rpc, i.e function call that is mapped, isn't /all/ that bad for very simple interfaces if you don't really worry about side-effects, or retries, or timeouts. if something goes wrong, you throw an exception and let the client code handle it. i use sync rpc a lot but pretty much everything is idempotent, and timeouts are fixed but overridable. it isn't the great satan steve vinowski makes it out to be

and for async stuff, although some advocate raw message passing as the true and future king of protocols, it's actually pretty conveient to be able to compose the result of rpc operations. now with futures, the code is a little more clunky but as a result it's very easy to compose operations that can operate concurrently.

then you have the church-of-fielding style criticism that argues that network services should be more like filesystems, rather than a precompiled list of function stubs. the rationale being that it's easier to compose these systems, use uniform middleware and components, and it's incredibly flexible. but it's actually possible to layer one over the other, they aren't so contradictory.


it's just a whole bunch of tradeoffs that people gloss over.

Sapozhnik
Jan 2, 2005

Nap Ghost
The last place I worked at used a combination of IBM MQSeries and ICE as their middleware

They used MQ as a parallel scatter-gather RPC and they took ICE's super stateful remote object protocol and used it to build something stateless.

In both cases the official API was a COM DLL that used the MQSeries and ICE libs/stubs as implementation details.

I'm not actually criticising either of these things per se because honestly compared to the poo poo that we had to interface with their code was solid gold. The early 2000s vintage shambling C++ code base at the center of it though... :negative: I still have nightmares about Boost mixed with ATL.

Otto Skorzeny posted:

The I2C library provided with the uC on my main project at work does this. You can probably imagine the results. (we eventually wrote our own for a variety of reasons, but this was the biggest)

Have you ever worked with Freescale's Cortex-M parts by any chance? A hardware guy I talk to a lot spent like a solid week bitching about one that he was forced to use in one of his projects. Fun fact about these chips: there's a flash configuration page at loving 0x400 in ROM. Not at the end, or at the beginning (vector table lives there) or even immediately after the vector table which would kind of almost have made sense, just randomly at 0x400, because why the gently caress not. Write something unlucky to that page and you'll permanently lock out the ISP connections and then it's just liek "sorry abut ur bricked mcu mang D:"

So anyway a friend of mine is working on a hobby project and decided to put a Teensy3 inside it and welp, guess what MCU that piece of poo poo uses. There's some mickey mouse Arduino dev environment for it but I need to turn it into a custom HID, obviously there's no LUFA support...

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip
Only Freescale parts I've worked with are the S08s, which are pretty good in their niche although somewhat more obnoxious to use from a hw designer perspective than more "modern" uCs (I don't think the line has been really worked on since the Motorola days). A product we shipped about a year ago uses one because it was available in a package with 42 dedicated LCD pins to drive custom glass, and its low power modes were good. Some of them have banked memory though which is :barf:

My current project uses a Cypress chip built around a Cortex M3 and it's terribad. The whole analog section is thunderfucked, we've found multiple bugs that they were unaware of which their FAEs can confirm and send up the chain to design but don't know any workarounds to, etc. We like the CortexM in general though, so we're looking at STM and a couple other vendors for the projects we have in the pipeline.

Sapozhnik
Jan 2, 2005

Nap Ghost
Look at EFM32 if you're doing anything low-power. They're a bit on the pricey side but they're just dreamlike to program for. The only major drawback is that they don't have JTAG, only SWD (so no OpenOCD for you and their licensed J-Link on the dev/eval boards sucks out loud) and the USB core in the bigger parts is rather lovely IP core licensed from Synopsys that doesn't integrate well with the other stuff on that chip in the slightest.

I kinda want to work in embedded but from what I hear a lot of HW guys will force you to use some terrible 8-bit crap instead of a nice Cortex. That and writing firmware for deep fat fryers or whatever doesn't exactly set my world on fire. Other than that embdev seems pretty fun

Bloody
Mar 3, 2013

Mr Dog posted:

they don't have JTAG

NOPE

Mr Dog posted:

Synopsys
NOOOOOOOOOOOPE



although to be honest those wonder geckos look pretty sweet if my project continues on i may actually have to check those out because id kinda like a very low power arm at this point

just looked at the datasheet hot drat that's low power that's almost msp430 territory

Bloody fucked around with this message at 16:10 on Jun 26, 2013

tef
May 30, 2004

-> some l-system crap ->
dear yospos

i'm gonna be doing a new jerb where I sorta you know write code, give talks and generally do a whole bunch of poo poo to mean that people can help kids learn through play

please give me a job title

Adbot
ADBOT LOVES YOU

Bloody
Mar 3, 2013

tef posted:

dear yospos

i'm gonna be doing a new jerb where I sorta you know write code, give talks and generally do a whole bunch of poo poo to mean that people can help kids learn through play

please give me a job title

autism specialist

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply