aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* Fail to another stream on default (no pipe requested).Garrett D'Amore2017-08-11
|
* Fix TTL handling for pair1 protocol; more tests.Garrett D'Amore2017-08-11
|
* Windows fixes; especially idempotent init/fini.Garrett D'Amore2017-08-11
| | | | | | | This fixes one major problem, which was that if nni_fini() was called once on Windows, it would not be further possible to call nni_init(). While here fixed a few compilation issues.
* Test support for pairv1 including polyamorous mode.Garrett D'Amore2017-08-11
|
* Posix pollq fini is not properly idempotent.Garrett D'Amore2017-08-11
| | | | | This creates a use-after-free bug if nni_fini() is run, then new sockets are created.
* Add 32-bit accessors for messages, and tests for them.Garrett D'Amore2017-08-11
|
* Leaking poll fds.Garrett D'Amore2017-08-11
| | | | | | | We never set the fd->sn_init member, causing new fds to be allocated on each request for a new pollfd, and causing old ones to leak, and worse may be even to not get notified. While here, we arrange for a bit richer testing against the various options.
* Verify errno handling works; use table driven approach.Garrett D'Amore2017-08-10
|
* Constructors missing from Windows DLLs.Garrett D'Amore2017-08-10
|
* Unify the msg API.Garrett D'Amore2017-08-10
| | | | | | | | | | | | | This makes the operations that work on headers start with nni_msg_header or nng_msg_header. It also renames _trunc to _chop (same strlen as _trim), and renames prepend to insert. We add a shorthand for clearing message content, and make better use of the endian safe 32-bit accessors too. This also fixes a bug in inserting large headers into messages. A test suite for message handling is included.
* Add new PAIR_V1 protocol.Garrett D'Amore2017-08-10
| | | | | | | | | | The PAIR_V1 protocol supports both raw and cooked modes, and has loop prevention included. It also has a polyamorous mode, wherein it allows multiple connections to be established. In polyamorous mode (set by an option), the sender requests a paritcular pipe by setting it on the message. We default to PAIR_V1 now.
* Thundering herd kills performance.Garrett D'Amore2017-08-10
| | | | | | | | | | | | | | A little benchmarking showed that we were encountering far too many wakeups, leading to severe performance degradation; we had a bunch of threads all sleeping on the same condition variable (taskqs) and this woke them all up, resulting in heavy mutex contention. Since we only need one of the threads to wake, and we don't care which one, let's just wake only one. This reduced RTT latency from about 240 us down to about 30 s. (1/8 of the former cost.) There's still a bunch of tuning to do; performance remains worse than we would like.
* fixes #47 compat_reqttls fails sometimesGarrett D'Amore2017-08-09
| | | | fixes #23 Restore the old idhash logic for sockets
* Fix problems found in Windows build.Garrett D'Amore2017-08-09
|
* fixes #44 open protocol by "name" (symbol) instead numberGarrett D'Amore2017-08-09
| | | | | | | | | | | | | | fixes #38 Make protocols "pluggable", or at least optional This is a breaking change, as we've done away with the central registered list of protocols, and instead demand the user call nng_xxx_open() where xxx is a protocol name. (We did keep a table around in the compat framework though.) There is a nice way for protocols to plug in via an nni_proto_open(), where they can use a generic constructor that they use to build a protocol specific constructor (passing their ops vector in.)
* fixes #37 Make transports pluggableGarrett D'Amore2017-08-08
| | | | | | | | | | | | We automatically register inproc, TCP, and IPC. We can add more now by just calling nni_tran_register(). (There is no unregister support.) This requires transports to have access to the AIO framework (so that needs to be something we consider), and a few nni_sock calls to get socket options. Going forward we should version the ops vectors, and move to pushing down transport options from the framework via setopt calls -- there is no reason really that transports need to know all these.
* Simplify initialization, fix error in closed TCP endpoint.Garrett D'Amore2017-08-08
|
* Fix compilation warnings.Garrett D'Amore2017-08-08
|
* Added nn_compat code for option handling, fixed other bugs.Garrett D'Amore2017-08-08
| | | | | | | Hop counts for REQ were busted (bad TTL), and imported the compat_reqtll test. At the same time, added code to nn_term to shut down completely, discarding sockets. (Note that some things, such as globals, may still be left around; that's ok.)
* Don't clear the AIO provider data in finish.Garrett D'Amore2017-08-07
| | | | | | The finish routine can race against an asynchronous cancellation, so we must not clear the data pointer, or we can wind up with a NULL pointer dereference.
* Add some more compatibility tests; fix surveyor compat bug.Garrett D'Amore2017-08-07
| | | | | | | | | We noticed a bug in the surveyor handling of the options; this fixes that. At the same time, we noticed a race condition in the setting of the error for future calls, a short sleep seems to cure it. This distinction (ESTATE vs ETIMEDOUT) is pretty annoying, and it would be better to have a different way to handle it. More work here is warranted.
* We use NNG_ETIMEDOUT from msgq now.Garrett D'Amore2017-08-07
|
* Fix crash when using legacy send API with NN_MSG.Garrett D'Amore2017-08-07
| | | | | | | | | We introduced the compat_msg.c from the old msg.c in the nanomsg repo. While here, we found that the handling for send() was badly wrong, by a level of indirection. We simplified the code to so that nn_send() and nn_recv() are simple wrappers around the nn_sendmsg() and nn_recvmsg() APIs (as in old nanomsg). This may not be quite as fast, but it's more likely to be correct and reduces complexity.
* Address possible leak on send failure.Garrett D'Amore2017-08-07
|
* Fix a few pointer vs. character errors found by gcc 7.Garrett D'Amore2017-08-07
|
* Remove unused idhash_reclaim.Garrett D'Amore2017-08-07
|
* Remove some dead code; msg queue depths are always unsigned.Garrett D'Amore2017-08-07
|
* Subsystem initialize is idempotent; simplify cleanup.Garrett D'Amore2017-08-07
|
* Fix warninsg about size types found in 64-bit windows build.Garrett D'Amore2017-08-05
|
* Don't shut down taskq too soon.Garrett D'Amore2017-08-05
| | | | | | | With the new reapers, we've seen some problems caused by the reaper running after the taskq that they have to wait on (completion tasks for aios) are destroyed. We need to make sure that we tear down major subsystems in the correct order.
* Minor improvements to reap start/stop logic.Garrett D'Amore2017-08-05
|
* Use dedicate reap thread for endpoints too.Garrett D'Amore2017-08-05
| | | | | | | This change mirrors the change we made for pipes yesterday, moving the endpoint cleanup to its own thread, ensuring that the blocking operations we need to perform during clean up do not gum up the works in the main system taskq.
* Use a dedicated reap thread instead of taskq.Garrett D'Amore2017-08-05
| | | | | | | | The problem is that reaping these things performs some blocking operations which can tie up slots in the taskq, preventing other tasks from running. Ultimately this can lead to a deadlock as tasks that are blocked wind up waiting for tasks that can't get scheduled. Blocking tasks really should not run on the system taskq.
* COnvert UDP to new style.Garrett D'Amore2017-08-04
|
* Refactor AIO logic to close numerous races and reduce complexity.Garrett D'Amore2017-08-04
| | | | | | | | | This passes valgrind 100% clean for both helgrind and deep leak checks. This represents a complete rethink of how the AIOs work, and much simpler synchronization; the provider API is a bit simpler to boot, as a number of failure modes have been simply eliminated. While here a few other minor bugs were squashed.
* More reliable taskq fini; avoids deadlock during shutdown.Garrett D'Amore2017-08-02
|
* Initial swag at UDP (POSIX only) low level handling.Garrett D'Amore2017-07-25
| | | | | | This includes async send and recv, driven from the poller. This will be requierd to support the underlying UDP and ZeroTier transports in the future. (ZeroTier is getting done first.)
* Update Capitar copyrights.Garrett D'Amore2017-07-21
|
* Eliminate the separate AIO wake callback, making nni_aio_waitGarrett D'Amore2017-07-21
| | | | block for any AIO completion.
* Simpler taskq API.Garrett D'Amore2017-07-21
| | | | | | | The queue is bound at initialization time of the task, and we call entries just tasks, so we don't have to pass around a taskq pointer across all the calls. Further, nni_task_dispatch is now guaranteed to succeed.
* fixes #28 Occasional orphaned pipe or endpoint?Garrett D'Amore2017-07-21
|
* Lets hold the lock a little while longer.Garrett D'Amore2017-07-20
|
* Yet more race condition fixes.Garrett D'Amore2017-07-20
| | | | | | | | | We need to remember that protocol stops can run synchronously, and therefore we need to wait for the aio to complete. Further, we need to break apart shutting down aio activity from deallocation, as we need to shut down *all* async activity before deallocating *anything*. Noticed that we had a pipe race in the surveyor pattern too.
* Always run the AIO completion logic.Garrett D'Amore2017-07-19
| | | | | | | | We have seen some yet another weird situation where we had an orphaned pipe, which was caused by not completing the callback. If we are going to run nni_aio_fini, we should still run the callback (albeit with a return value of NNG_ECANCELED or somesuch) to be sure that we can't orphan stuff.
* Crash on close again.Garrett D'Amore2017-07-19
| | | | | | | | | | | This one is caused by us deallocating the msg queue before we stop all asynchronous I/O operations; consequently we can wind up with a thread trying to access a msg queue after it has been destroyed. A lesson here is that nni_aio_fini() needs to be treated much like nni_thr_fini() - you should do this *before* deallocating anything that callback functions might be referencing.
* fixes #27 Double free found in stress testingGarrett D'Amore2017-07-19
|
* Possible division by zero error (unset backoff start time).Garrett D'Amore2017-07-18
|
* fixes #21 Crash in IPC (POSIX)Garrett D'Amore2017-07-18
| | | | | | This resolves the orphaned pipedesc, which actually could have affected Windows too. I think maybe we are race free. Lots more testing is still required, but stress runs seem to be passing now.
* Fixes most of the raaces in posix; but at least one remains outstanding.Garrett D'Amore2017-07-18
| | | | | | Apparently there are circumstances when a pipedesc may get orphaned form the pollq. This triggers an assertion failure when it occurs. I am still trying to understand how this can occur. Stay tuned.
* Sometimes providers don't clear the prov data details. (Backoff).Garrett D'Amore2017-07-18
|