Giter Club home page Giter Club logo

Comments (18)

myronahn avatar myronahn commented on May 10, 2024

Versions:

[org.clojure/clojure "1.2.1"]
[org.clojure/clojure-contrib "1.2.0"]
[aleph "0.2.1-alpha1"]
[gloss "0.2.1-alpha1"]
[compojure "0.6.5"]

Tried upgrading to 0.2.1-rc1 but couldn't not get through the test above without errors.

from aleph.

ztellman avatar ztellman commented on May 10, 2024

What version of Aleph are you using?

from aleph.

myronahn avatar myronahn commented on May 10, 2024

Zach, you are so fast. Version info above.

from aleph.

ztellman avatar ztellman commented on May 10, 2024

You're getting errors from running this in 0.2.1-rc1? That's not good, what are you seeing?

from aleph.

myronahn avatar myronahn commented on May 10, 2024

I'll give it a try right now and report the errors here.

from aleph.

myronahn avatar myronahn commented on May 10, 2024

Okay, turns out the example above works in 0.2.1-rc1, but when I actually try to subscribe to a redis channel, it errors out.

(ns test.test
  (:use aleph.formats
        lamina.core))

(def ch1 (aleph.redis/redis-stream {:host "localhost", :port 6379}))
(on-closed ch1 #(println "ch1 closed"))
(aleph.redis/subscribe ch1 "babe")

The last line that subscribes to the redis channel errors out in 0.2.1-rc1, but is fine in 0.2.1-alpha1. So we ended up using alpha1 for now.

from aleph.

ztellman avatar ztellman commented on May 10, 2024

What's the error when you try to subscribe?

from aleph.

myronahn avatar myronahn commented on May 10, 2024

Sorry, my bad:

2012-05-08 17:24:51,229 WARN  lamina.core.pipeline: Unhandled exception in pipeline.
java.lang.IllegalArgumentException: No implementation of method: :read-bytes of protocol: #'gloss.core.protocols/Reader found for class: nil
    at clojure.core$_cache_protocol_fn.invoke(core_deftype.clj:471)
    at gloss.core.protocols$fn__2411$G__2406__2418.invoke(protocols.clj:19)
    at gloss.core.codecs$header$fn__3168.invoke(codecs.clj:22)
    at gloss.core.protocols$compose_callback$reify__2463.read_bytes(protocols.clj:58)
    at gloss.core.codecs$header$reify__3170.read_bytes(codecs.clj:26)
    at gloss.core.protocols$compose_callback$reify__2463.read_bytes(protocols.clj:56)
    at gloss.core.structure$compile_frame$reify__3165.read_bytes(structure.clj:120)
    at gloss.io$decode_byte_sequence.invoke(io.clj:130)
    at gloss.io$decode_channel$fn__3715$fn__3716.invoke(io.clj:153)
    at lamina.core.pipeline$start_pipeline$fn__1046$fn__1064.invoke(pipeline.clj:208)
    at lamina.core.pipeline$start_pipeline$fn__1046.invoke(pipeline.clj:207)
    at lamina.core.pipeline$start_pipeline.invoke(pipeline.clj:164)
    at lamina.core.pipeline$start_pipeline$fn__1046$fn__1050$f__997__auto____1052$fn__1053.invoke(pipeline.clj:196)
    at clojure.lang.AFn.applyToHelper(AFn.java:159)
    at clojure.lang.AFn.applyTo(AFn.java:151)
    at clojure.core$apply.invoke(core.clj:540)
    at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1502)
    at clojure.lang.RestFn.invoke(RestFn.java:425)
    at lamina.core.pipeline$start_pipeline$fn__1046$fn__1050$f__997__auto____1052.invoke(pipeline.clj:188)
    at lamina.core.pipeline$start_pipeline$fn__1046$fn__1050.invoke(pipeline.clj:187)
    at lamina.core.queue$r_obs$fn__894.invoke(queue.clj:287)
    at lamina.core.observable$observer$reify__348.on_message(observable.clj:43)
    at lamina.core.observable.ConstantObservable$fn__563.invoke(observable.clj:202)
    at lamina.core.observable.ConstantObservable.message(observable.clj:198)
    at lamina.core.channel$enqueue.doInvoke(channel.clj:136)
    at clojure.lang.RestFn.invoke(RestFn.java:423)
    at lamina.core.channel$poll$callback__971$fn__972$fn__973.invoke(channel.clj:213)
    at lamina.core.queue$l_obs$fn__898.invoke(queue.clj:293)
    at lamina.core.observable$observer$reify__348.on_message(observable.clj:43)
    at lamina.core.observable.ConstantObservable$fn__563.invoke(observable.clj:202)
    at lamina.core.observable.ConstantObservable.message(observable.clj:198)
    at lamina.core.channel$enqueue.doInvoke(channel.clj:136)
    at clojure.lang.RestFn.invoke(RestFn.java:423)
    at lamina.core.pipeline$success_BANG_.invoke(pipeline.clj:87)
    at lamina.core.pipeline$read_channel$fn__1119.invoke(pipeline.clj:335)
    at lamina.core.queue$r_obs$fn__894.invoke(queue.clj:287)
    at lamina.core.observable$observer$reify__348.on_message(observable.clj:43)
    at lamina.core.observable.ConstantObservable$fn__563.invoke(observable.clj:202)
    at lamina.core.observable.ConstantObservable.message(observable.clj:198)
    at lamina.core.channel$enqueue.doInvoke(channel.clj:136)
    at clojure.lang.RestFn.invoke(RestFn.java:423)
    at lamina.core.channel$poll$callback__971$fn__972$fn__973.invoke(channel.clj:213)
    at lamina.core.queue$send_to_callbacks.invoke(queue.clj:227)
    at lamina.core.queue.EventQueue.enqueue(queue.clj:109)
    at lamina.core.queue$setup_observable__GT_queue$fn__879.invoke(queue.clj:235)
    at lamina.core.observable$observer$reify__348.on_message(observable.clj:43)
    at lamina.core.observable.Observable.message(observable.clj:128)
    at lamina.core.observable$siphon$fn__601$fn__603.invoke(observable.clj:243)
    at lamina.core.observable$observer$reify__348.on_message(observable.clj:43)
    at lamina.core.observable.Observable.message(observable.clj:128)
    at lamina.core.observable$siphon$fn__601$fn__603.invoke(observable.clj:243)
    at lamina.core.observable$observer$reify__348.on_message(observable.clj:43)
    at lamina.core.observable.Observable.message(observable.clj:128)
    at lamina.core.observable$siphon$fn__601$fn__603.invoke(observable.clj:243)
    at lamina.core.observable$observer$reify__348.on_message(observable.clj:43)
    at lamina.core.observable.Observable.message(observable.clj:125)
    at lamina.core.channel$enqueue.doInvoke(channel.clj:136)
    at clojure.lang.RestFn.invoke(RestFn.java:423)
    at aleph.tcp$basic_client_pipeline$fn__5376.invoke(tcp.clj:109)
    at aleph.netty$message_stage$reify__3433.handleUpstream(netty.clj:139)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:545)
    at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:754)
    at aleph.netty$upstream_stage$reify__3425.handleUpstream(netty.clj:122)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:545)
    at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:754)
    at aleph.netty$upstream_stage$reify__3425.handleUpstream(netty.clj:122)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:545)
    at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:754)
    at aleph.netty$upstream_stage$reify__3425.handleUpstream(netty.clj:122)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:545)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:540)
    at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:274)
    at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:261)
    at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:349)
    at org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:280)
    at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:200)
    at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
    at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:44)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:680)

from aleph.

myronahn avatar myronahn commented on May 10, 2024

Oh, BTW, when I said it "works" in rc1, I mean the code doesn't error out (unless I add the subscribe statement).

0.2.1-rc1 still seems to not close the original redis-stream when I close ch3.

BTW, your responses are much appreciated.

from aleph.

ztellman avatar ztellman commented on May 10, 2024

I'm unable to reproduce your issue with the subscribe statement in rc1, but I was able to determine the cause of the closing issue. The fix is available in 0.2.1-rc2.

Can you confirm that the new version fixes the closing issue for you, and can you provide me with a gist containing code that, when run, will print out the above error?

from aleph.

myronahn avatar myronahn commented on May 10, 2024

I'm on it.

from aleph.

myronahn avatar myronahn commented on May 10, 2024

Confirmed aleph 0.2.1-rc2 fixed the closing issue for me.

from aleph.

myronahn avatar myronahn commented on May 10, 2024

Here is the gist:

core.clj: https://gist.github.com/2634409
project.clj: https://gist.github.com/2634411

from aleph.

myronahn avatar myronahn commented on May 10, 2024

(this is run under lein)

from aleph.

ztellman avatar ztellman commented on May 10, 2024

Okay! So here's what happened: you were using 1.2.1, and I was using 1.3.

The problem was that there was a recent change in Gloss where enumeration values were meant to be stored as longs, but that was inconsistent in some cases. In 1.3, number lookups are consistent no matter what, but in 1.2 that's not the case. It was only once I used your project.clj with 1.2.1 that I started seeing the problem.

Anyway, it's fixed in 0.2.1-rc3, which is the same as the previous RC except that it points at the latest Gloss. Let me know if you have any other issues.

from aleph.

ztellman avatar ztellman commented on May 10, 2024

Also, thank you for bringing this to my attention, and for coming up with a reproducible example that included the project.clj.

from aleph.

myronahn avatar myronahn commented on May 10, 2024

Zach, I am out and about now but I will try your fix as soon as I get
home.

Also, I should really be thanking you for your quick fixes - providing a
standalone reproducible case is the least I can do. Much appreciated,
Zach!

from aleph.

myronahn avatar myronahn commented on May 10, 2024

Confirmed that if I use aleph-0.2.1-rc3 (which pulls down gloss-0.2.1-rc2), everything works fine. Thanks again Zach!

from aleph.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.