Comments (18)
What I am seeing after trying to use the client. Basically sending a query(?) over a TCP connection that includes the key and the key type:
11:10:38.450 [error] gen_server <0.682.0> terminated with reason: bad argument in call to erlang:binary_to_term(<<10,20,10,5,111,114,115,101,116,18,11,115,116,97,116,101,95,111,114,115,101,116>>) in partisan_peer_service_server:decode/1 line 142
11:10:38.451 [error] CRASH REPORT Process <0.682.0> with 0 neighbours crashed with reason: bad argument in call to erlang:binary_to_term(<<10,20,10,5,111,114,115,101,116,18,11,115,116,97,116,101,95,111,114,115,101,116>>) in partisan_peer_service_server:decode/1 line 142
11:10:38.457 [error] Supervisor partisan_pool had child {partisan_peer_service_server,{{127,0,0,1},53011},
{{127,0,0,1},53008},
#Ref<0.2197086231.2935226369.252456>} started with {partisan_peer_service_server,acceptor_init,undefined} at <0.682.0> exit with reason bad argument in call to erlang:binary_to_term(<<10,20,10,5,111,114,115,101,116,18,11,115,116,97,116,101,95,111,114,115,101,116>>) in partisan_peer_service_server:decode/1 line 142 in context child_terminated
Where <<10,20,10,5,111,114,115,101,116,18,11,115,116,97,116,101,95,111,114,115,101,116>>
can be successfully decoded by lasp_pb
.
from lasp.
I see, the partisan_peer_service_server
is lacking a check for a valid lasp_pb
message.
from lasp.
Would adding something like
try
lasp_pb:decode_msg(Message, req)
catch
_:_ -> term_to_binary(Message).
Be an acceptable change to partisan (with the other required changes if needed)?
from lasp.
I'm confused. Partisan is more general purpose than Lasp, so it should not contain any Lasp related code. (in fact, I'm not sure why any of the Lasp protocol buffer code should be going through Partisan itself.)
from lasp.
Yeah that's what I was afraid of. Are the messages encoded by the protocol buffer incompatible with partisan now? I don't really see any kind of optional decode module.
from lasp.
I guess my question here is why are those messages going through Partisan? Partisan is for internode communication only -- I don't see a reason the client should be using it at all.
from lasp.
Maybe I'm communicating with the wrong port then?
lsof -Pan -p <lasp_pid> -i
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
beam.smp 13476 mpope 33u IPv4 0xab667c288b61d1d5 0t0 TCP *:56397 (LISTEN)
beam.smp 13476 mpope 34u IPv4 0xab667c289dc6edf5 0t0 TCP 127.0.0.1:56398->127.0.0.1:4369 (ESTABLISHED)
beam.smp 13476 mpope 40u IPv4 0xab667c28933e0c05 0t0 TCP 127.0.0.1:56399 (LISTEN)
Is how I am finding it, and the bottom port was the only one that I could connect to.
from lasp.
If you're getting a partisan message, you're probably connecting to the wrong port.
from lasp.
The partisan port is under the partisan_config:get(listen_addrs)
command you can issue in the remote shell, if you connect.
cc: @goncalotomas
from lasp.
Yeah, that was totally the Partisan port, my mistake. What port would be the one that I would connect to then? The web_port 8080
does not seem to work.
{:ok, socket} = :laspc_pb_socket.start_link({127,0,0,1}, 8080)
** (MatchError) no match of right hand side value: {:error, :econnrefused}
Running lasp using
make shell
from lasp.
From a quick grep, it doesn't look like any of the protocol buffer client stuff was ever pulled into the mainline and I'm not sure why. I wasn't working on it, @goncalotomas was (as part of his Google Summer of Code project), so maybe he can point you to the branch where the work was done.
from lasp.
So is the web_port the intended port to be doing this communication over?
from lasp.
No, the web_port is used for the web interface that Lasp exports for debugging the overlay. You're looking for pb_port, which isn't in the main branch.
from lasp.
Ahh, so if the pb integration isn't finished whats the best way to communicate with the lasp server?
from lasp.
Just connecting a node directly at this point?
from lasp.
Right now, we're assuming nodes are running an instance of Lasp (or, communicate via RPC.)
from lasp.
Hey.
The Lasp Erlang client was designed to interact directly to Lasp nodes via protocol buffer messages, without any interference with/from Partisan. At the time, I was working on defining the messages and Vitor was helping me make sure that popular Lasp operations could be encoded.
The changes to the client were easy since we were working on a separate repository, but at the same time types was undergoing some significant changes if I recall correctly. My work depended on the newer versions of types, but Lasp lagged behind for a while after GSoC ended and that is why these changes never made it in.
I don't recall the full status of the server side, but I can take a look at it later and see if there is an easy way to merge the missing work back into mainline. I was basically adding another process to the Lasp supervisor, a gen_server
, which was decoding the operations and calling the appropriate functions.
from lasp.
That would be killer! Let me know if there is anything I can do to help.
from lasp.
Related Issues (20)
- upgrade to latest gen_flow HOT 3
- enforce_once triggering more than expected HOT 3
- Can't use in an Elixir mix project HOT 12
- Lasp.stream/2 callbacks are not invoked when state_orset changes HOT 2
- Provide an option to trigger sync on update HOT 1
- Allow to force gossip to syncrhonize HOT 2
- Tree based dissemination mode is crashing. HOT 1
- peer service gossips to all members HOT 1
- Deltas don't support blocking sync option HOT 1
- Deltas don't support forced propagation option HOT 1
- Make it possible to undeclare variables HOT 13
- Syncing initial state or state after a crash where state is lost
- Fail to Compile: Getting log of git dependency failed in /dir/to/lasp-master/. Falling back to version 0.0.0 HOT 9
- Erlang 21 incompatible HOT 4
- Delayed lasp:stream function call
- Read with threshold and maximum blocking duration HOT 1
- Memory leak ? HOT 10
- Deadlock when calling lasp:query/1 HOT 2
- Website is down HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lasp.