threerings / nexus Goto Github PK
View Code? Open in Web Editor NEWDistributed interactive application development framework
License: Other
Distributed interactive application development framework
License: Other
I have a prototype using nexus and am getting an intermittent crash in the server when a client disconnects. The proximate cause is a null pointer, but it looks like there may be some deeper thread safety issues with JVMServerConnection._chan.
I'm calling nexus.clearKeyed for any objects associated with the client, on the signal SessionLocal.getSession().onDisconnect(). The crash occurs after that, when some downstream messages are sent to the disconnected client.
Stack trace:
Thread [JVMConnectionManager I/O writer] (Suspended (exception NullPointerException))
JVMConnectionManager.connectionClosed(SocketChannel, IOException) line: 192
JVMServerConnection.onClose(IOException) line: 137
JVMServerConnection.writeMessages() line: 72
JVMConnectionManager.writeLoop() line: 242
JVMConnectionManager$3.run() line: 83
In the debugger, I can see that _chan is null. The write loop is terminated and the server stops working.
Console output. The first line here is printed from disconnect slot:
protomgr: Player logged out [name=jamie]
Feb 10, 2014 5:42:55 AM com.threerings.nexus.util.Log$JavaLogger log
INFO: Connection closed [addr=/127.0.0.1, cause=null]
Feb 10, 2014 5:42:55 AM com.threerings.nexus.util.Log$JavaLogger log
WARNING: Attempted to disconnect while already disconnecting.
java.nio.channels.ClosedChannelException
at sun.nio.ch.SocketChannelImpl.ensureWriteOpen(SocketChannelImpl.java:135)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:326)
at com.threerings.nexus.server.JVMServerConnection.writeMessages(JVMServerConnection.java:52)
at com.threerings.nexus.server.JVMConnectionManager.writeLoop(JVMConnectionManager.java:242)
at com.threerings.nexus.server.JVMConnectionManager$3.run(JVMConnectionManager.java:83)
I have a service method which wants to returns an array of strings, i.e.:
interface FooService {
RFuture<String[]> getNames ();
}
When running the implementation, nexus complains about a missing Streamer_String class. I looked at it briefly and it seems to not support arrays. I figure this is an oversight since arrays are supported elsewhere.
Exception:
com.threerings.nexus.io.StreamException: Error instantiating streamer [Ljava.lang.Streamer_String;
at com.threerings.nexus.io.JVMIO.findStreamer(JVMIO.java:376)
at com.threerings.nexus.io.JVMIO$2.resolveAndWriteClass(JVMIO.java:336)
at com.threerings.nexus.io.JVMIO$2.writeStreamer(JVMIO.java:323)
at com.threerings.nexus.io.Streamable$Output.writeValue(Streamable.java:304)
...
Caused by: java.lang.ClassNotFoundException: java.lang.Streamer_String
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
At the top level, there's a pom for 'nexus-project', but the ant file at that level just recurses into the OTHER things and builds those poms, so if you follow the README's instructions, trying to run the chat demo fails because you don't have the meta package built.
Although I'm a little confused since looking at the poms, I don't see how it would depend on that, plus running 'mvn dependency:tree' doesn't list it, but experimentally it sure screamed about missing that until I just built everything from at the top level directly with mvn instead of ant.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.