-
Notifications
You must be signed in to change notification settings - Fork 594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A few pool improvements #1660
A few pool improvements #1660
Conversation
jrudolph
commented
Dec 19, 2017
- no unbounded response buffers, in a code comment I previously speculated whether buffering would be ok or not. I figured, probably unbounded buffering is not so cool so I removed it. Now the outgoing result is buffered in the slot until it is fetched
- some additional failure handlers
Test PASSed. |
9aea8eb
to
7c5b0b5
Compare
Test PASSed. |
} | ||
|
||
override def onConnectionFailed(ctx: SlotContext, cause: Throwable): SlotState = { | ||
ctx.debug("Connection failed.") | ||
// FIXME: register failed connection attempt, schedule request for rerun, backoff new connection attempts | ||
ctx.closeConnection() | ||
ctx.dispatchFailure(ongoingRequest, cause) | ||
Unconnected | ||
// FIXME: register failed connection attempt, backoff new connection attempts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ticketify?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's basically #1391 but I'll add it to the comment.
|
||
eventually { | ||
a[Throwable] should be thrownBy oneCycle() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the error message here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A timeout that a push / expect didn't go through because of backpressure. Hard to test otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing method is fine, just wondering if the message is understandable :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine, one question
d4202d2
to
478d8c0
Compare
Test FAILed. |
478d8c0
to
8422111
Compare
|
||
eventually { | ||
// should fail eventually because backpressure kicks in and one of the expects / pushes above will timeout | ||
a[Throwable] should be thrownBy oneCycle() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks :)
Test PASSed. |
@@ -34,6 +36,8 @@ private[pool] abstract class SlotContext { | |||
|
|||
def debug(msg: String): Unit | |||
def debug(msg: String, arg1: AnyRef): Unit | |||
def debug(msg: String, arg1: AnyRef, arg2: AnyRef): Unit | |||
def debug(msg: String, arg1: AnyRef, arg2: AnyRef, arg3: AnyRef): Unit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
} | ||
final case class WaitingForResponse(ongoingRequest: RequestContext) extends ConnectedState with BusyState { | ||
override def onResponseReceived(ctx: SlotContext, response: HttpResponse): SlotState = | ||
WaitingForResponseDispatch(ongoingRequest, Success(response)) | ||
|
||
override def onConnectionFailed(ctx: SlotContext, cause: Throwable): SlotState = | ||
WaitingForResponseDispatch(ongoingRequest, Failure(cause)) | ||
// connection failures are handled by BusyState implementations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for leaving those comments 👍
Looked at all commits one by one and changes look good. LGTM |
ec264c8
to
ae9df09
Compare
Test FAILed. |
PLS BUILD |
Test FAILed. |
PLS BUILD |
Test PASSed. |
Finally ;) |