Skip to content
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

Fixed client runtime #174

Merged
merged 3 commits into from
Oct 27, 2019
Merged

Fixed client runtime #174

merged 3 commits into from
Oct 27, 2019

Conversation

barambani
Copy link
Member

This should reestablish correctness of the client and the CLI after the upgrade to the latest fs2. I will address possible performance regressions and the automation to build the CLI in follow-up PRs.

@barambani barambani requested a review from sirocchj October 27, 2019 02:57
@codecov-io
Copy link

codecov-io commented Oct 27, 2019

Codecov Report

Merging #174 into master will decrease coverage by 0.25%.
The diff coverage is 40.5%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #174      +/-   ##
==========================================
- Coverage   61.39%   61.13%   -0.26%     
==========================================
  Files          36       36              
  Lines        1202     1194       -8     
  Branches        8        7       -1     
==========================================
- Hits          738      730       -8     
  Misses        464      464
Impacted Files Coverage Δ
fs2/src/main/scala/laserdisc/fs2/fs2.scala 100% <ø> (ø) ⬆️
cli/src/main/scala/laserdisc/cli/CLI.scala 0% <0%> (ø) ⬆️
fs2/src/main/scala/laserdisc/fs2/RedisClient.scala 65.51% <73.52%> (-7.62%) ⬇️
...s2/src/main/scala/laserdisc/fs2/RedisChannel.scala 73.68% <77.77%> (ø)
core/src/main/scala/laserdisc/protocol/RESP.scala 86.5% <0%> (+0.79%) ⬆️
core/src/main/scala/laserdisc/protocol/KeyP.scala 92.68% <0%> (+1.21%) ⬆️
...s2/src/main/scala/laserdisc/fs2/RedisAddress.scala 60% <0%> (+20%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a9b12aa...573a4fb. Read the comment docs.

sirocchj
sirocchj previously approved these changes Oct 27, 2019
Copy link
Member

@sirocchj sirocchj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're on 🔥

tb.parse {
s"""import laserdisc._
|import laserdisc.auto._
|import laserdisc.all._
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we need this for now (see here) or we lose the ability to just invoke all protocols w/o prefix in the CLI

Copy link
Member Author

@barambani barambani Oct 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the protocols in all are already imported by laserdisc._. If I add it and run

localhost:6379> strings.set("a", 23)

I get

reflective compilation has failed:

reference to strings is ambiguous;
it is imported twice in the same scope by
import laserdisc.all._
and import laserdisc._
localhost:6379>

The one that doesn't seem to be found is BListP though. Do they need to be hierarchical ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, in theory it should be just set(“a”, 23)

strings is another object that extends StringP (Like all, which extends all protocols)

@@ -4,6 +4,7 @@ package fs2
import java.net.InetSocketAddress

import _root_.fs2.{Chunk, Pull}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import _root_.fs2.{Chunk, Pull}

@@ -7,3 +7,4 @@ addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.29")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.3.7")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.0")
addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.10.0-RC1")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.10")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need it to produce the the CLI assembly. It doesn't work in sbt so I have to run it trough the Jar. That's still a problem, I couldn't find a way to make it progress in an sbt run. It hangs and needs to be killed. If started with

java -jar <the jar> localhost 6379

works fine.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And yes, would love to understand why it hangs there if used within sbt

serverUnavailable.flatMap(address => runner(Stream.emit(Some(address))))

case _ =>
case None =>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we not missing a case now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, fixing it.

@sirocchj
Copy link
Member

:shipit:

sirocchj
sirocchj previously approved these changes Oct 27, 2019
@barambani
Copy link
Member Author

I'm spending a bit of time trying find out why CLI hangs or, if I fork the jvm on run, doesn't stop waiting for input but successfully finishes.

@barambani
Copy link
Member Author

I pushed the missing import. I have another strategy in mind for the CLI, but it deserves a separate PR. I would merge this as it is then.

Copy link
Member

@sirocchj sirocchj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let’s merge this :)

@barambani barambani merged commit ca2ffb1 into laserdisc-io:master Oct 27, 2019
@barambani barambani deleted the fixing-client-runtime branch October 27, 2019 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants