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

testConcurrentDeliveryOnDifferentChannels sporadic crash #56

Closed
camelpunch opened this issue Apr 28, 2016 · 2 comments
Closed

testConcurrentDeliveryOnDifferentChannels sporadic crash #56

camelpunch opened this issue Apr 28, 2016 · 2 comments
Labels

Comments

@camelpunch
Copy link
Contributor

camelpunch commented Apr 28, 2016

This usually happens during a semaphore wait, but that could be coincidental.

Possibly unrelated: increasing the channel count to 1000 produces some interesting errors.

Many of these:

2016-04-28 16:07:36.697 xctest[47665:2264431] Received connection: <RMQConnection: 0x7fd5ab80bbf0> failedToOpenChannel: <RMQAllocatedChannel: 0x7fd5a9d312f0> {
    active = 1;
    channelNumber = 88;
    commandQueue = "<RMQGCDSerialQueue: 0x7fd5a9d2ed50>";
    consumers =     {
    };
    delegate = "<RMQQueuingConnectionDelegateProxy: 0x7fd5ab80e330>";
    exchanges =     {
    };
    nameGenerator = "<RMQProcessInfoNameGenerator: 0x7fd5ab80c9b0>";
    prefetchCount = 0;
    prefetchGlobal = 0;
    queues =     {
        "rmq-objc-client.gen-DE4A0490-0FFE-4F48-93C5-3B250E17EE17-47665-00009AAFB74ACF97" = "<RMQQueue: 0x7fd5a9e09260>";
    };
    sender = "<RMQConnection: 0x7fd5ab80bbf0>";
    waiter = "<RMQFramesetSemaphoreWaiter: 0x7fd5a9d30b40>";
} error: Error Domain=com.rabbitmq.rabbitmq-objc-client Code=3 "Timed out waiting for RMQChannelOpenOk." UserInfo={NSLocalizedDescription=Timed out waiting for RMQChannelOpenOk.}

Then many of these:

2016-04-28 16:07:38.445 xctest[47665:2264437] Received channel: <RMQAllocatedChannel: 0x7fd5a9cf0770> {
    active = 1;
    channelNumber = 594;
    commandQueue = "<RMQGCDSerialQueue: 0x7fd5a9cefa00>";
    consumers =     {
    };
    delegate = "<RMQQueuingConnectionDelegateProxy: 0x7fd5ab80e330>";
    exchanges =     {
    };
    nameGenerator = "<RMQProcessInfoNameGenerator: 0x7fd5ab80c9b0>";
    prefetchCount = 0;
    prefetchGlobal = 0;
    queues =     {
        "rmq-objc-client.gen-DE4A0490-0FFE-4F48-93C5-3B250E17EE17-47665-00009AAFB74ACF97" = "<RMQQueue: 0x7fd5a9cf10e0>";
    };
    sender = "<RMQConnection: 0x7fd5ab80bbf0>";
    waiter = "<RMQFramesetSemaphoreWaiter: 0x7fd5a9ceffd0>";
} error: Error Domain=com.rabbitmq.rabbitmq-objc-client Code=4 "Expected RMQQueueDeclareOk, got RMQChannelOpenOk." UserInfo={NSLocalizedDescription=Expected RMQQueueDeclareOk, got RMQChannelOpenOk.}

The above is probably #57

I suspect we're flooding the socket with writes and not handling reads in between.

@camelpunch camelpunch added the bug label Apr 28, 2016
@camelpunch camelpunch changed the title Concurrent delivery on different channels test sporadic crash testConcurrentDeliveryOnDifferentChannels sporadic crash Apr 28, 2016
@camelpunch
Copy link
Contributor Author

camelpunch commented Apr 30, 2016

Removing the heartbeat code makes this test pass reliably. We need to re-implement client heartbeats with a timer dispatch source

@camelpunch
Copy link
Contributor Author

It turns out this is a -[__NSDate release]: message sent to deallocated instance. It only occurs when last activity date recording code is present.

camelpunch added a commit that referenced this issue May 2, 2016
camelpunch added a commit that referenced this issue May 2, 2016
camelpunch added a commit that referenced this issue May 2, 2016
It turns out that changing the date property from nonatomic to atomic
was the key to fixing Issue #56, but the timer source implementation is
more efficient according to the Apple docs:

https://developer.apple.com/library/mac/documentation/General/Conceptual/ConcurrencyProgrammingGuide/GCDWorkQueues/GCDWorkQueues.html#//apple_ref/doc/uid/TP40008091-CH103-SW2
camelpunch added a commit that referenced this issue May 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant