celluloid / celluloid-io

UNMAINTAINED: See celluloid/celluloid#779 - Evented sockets for Celluloid actors
https://celluloid.io
MIT License
879 stars 93 forks source link

Less dramatic outcome for Errno::ETIMEDOUT case. #93

Closed digitalextremist closed 8 years ago

digitalextremist commented 10 years ago

Adjusts/replaces #61 and closes #62.

@halorgium, I believe this is a good way to handle Errno::ETIMEDOUT gracefully -- return how much was written, rather than passing along a "crash" ... This might be flawed reasoning however.

Please consider: If it is necessary to be sure something crossed the wire, the upstream needs to check total_written is valid. But for those who don't care about the outcome per se, there is no exception raised to take out an actor.

My thought is that an actor's life can be spared, and whatever ought to run after a response is written can be run. For example, I save state and do some per-connection cleanup which a termination is not. Whether the transfer was correct is the responsibility of upstream code, if high accuracy is needed, but for the majority of cases, accuracy is optional.

coveralls commented 10 years ago

Coverage Status

Coverage remained the same when pulling 9c2ad27303bc2a5fca54b4c860eeeec057cb23cd on decentrality:etimedout-rescue into b12dff20db97cc96b5666416d6f0235f152c8d78 on celluloid:master.

ioquatix commented 8 years ago

This is old. Can we please review and close if no longer useful?

ioquatix commented 8 years ago

I'm concerned that this behaviour wouldn't allow the user to handle the case explicitly. I think this is something we should revisit in the future, but for now I'm going to close this PR.

digitalextremist commented 8 years ago

Agreed, will re-raise in future if needed. But will probably implement a different "dynamic rescue" allowing injection of specialized rescues if needed.