Comments (24)
Would you be able to provide the scenarios that can be replicated that lead to stack overflow?
from c-sharp.
@DanielDignam As @budgetpreneur requests, please let us know which version you pulled, and how to reproduce this issue.
from c-sharp.
We pulled 3.4.0.1, there recursive error recovery appears to sill be there in 3.4.0.2. Unfortunately, I don't have a simple reproducible case.
The error condition arose for us on a machine restoring from hibernate state. We would get an error 'cascade'
[2013-12-23 10:46:45,862] [17] [ERROR] [PubNubMessaging.Core.Pubnub] [(null)] [(null)] [(null)] - DateTime 23/12/2013 10:46:45, WebException: System.Net.WebException: The remote name could not be resolved: 'pubsub.pubnub.com'
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at PubNubMessaging.Core.PubnubWebRequest.EndGetResponse(IAsyncResult asyncResult)
at PubNubMessaging.Core.Pubnub.UrlProcessResponseCallback[T](IAsyncResult asynchronousResult) for URL: http://pubsub.pubnub.com/subscribe/sub-c-f3158300-f382-11e2-b871-02ee2ddab7fe/private-member-channel-341507-f9ced127bbc394a491219030df464f3040a52f44f24d8fd34caf2f5793e7dcab/0/13877951283212765?uuid=63aa23d9-dfee-49cf-bbc6-f9b24e897ecc
[2013-12-23 10:46:45,992] [14] [INFO ] [PubNubMessaging.Core.Pubnub] [(null)] [(null)] [(null)] - DateTime: 23/12/2013 10:46:45, OnPubnubWebRequestTimeout: client request timeout reached.Request abort for channel = private-member-channel-341507-f9ced127bbc394a491219030df464f3040a52f44f24d8fd34caf2f5793e7dcab
[2013-12-23 10:46:46,005] [17] [INFO ] [PubNubMessaging.Core.Pubnub] [(null)] [(null)] [(null)] - DateTime 23/12/2013 10:46:46, Building request for channel(s)=private-member-channel-341507-f9ced127bbc394a491219030df464f3040a52f44f24d8fd34caf2f5793e7dcab with timetoken=13877951283212765
[2013-12-23 10:46:46,006] [17] [INFO ] [PubNubMessaging.Core.Pubnub] [(null)] [(null)] [(null)] - DateTime 23/12/2013 10:46:46, Request=http://pubsub.pubnub.com/subscribe/sub-c-f3158300-f382-11e2-b871-02ee2ddab7fe/private-member-channel-341507-f9ced127bbc394a491219030df464f3040a52f44f24d8fd34caf2f5793e7dcab/0/13877951283212765?uuid=63aa23d9-dfee-49cf-bbc6-f9b24e897ecc
[2013-12-23 10:46:46,008] [17] [ERROR] [PubNubMessaging.Core.Pubnub] [(null)] [(null)] [(null)] - DateTime 23/12/2013 10:46:46, WebException: System.Net.WebException: The remote name could not be resolved: 'pubsub.pubnub.com'
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at PubNubMessaging.Core.PubnubWebRequest.EndGetResponse(IAsyncResult asyncResult)
at PubNubMessaging.Core.Pubnub.UrlProcessResponseCallback[T](IAsyncResult asynchronousResult) for URL: http://pubsub.pubnub.com/subscribe/sub-c-f3158300-f382-11e2-b871-02ee2ddab7fe/private-member-channel-341507-f9ced127bbc394a491219030df464f3040a52f44f24d8fd34caf2f5793e7dcab/0/13877951283212765?uuid=63aa23d9-dfee-49cf-bbc6-f9b24e897ecc
[2013-12-23 10:46:46,009] [17] [INFO ] [PubNubMessaging.Core.Pubnub] [(null)] [(null)] [(null)] - DateTime 23/12/2013 10:46:46, Building request for channel(s)=private-member-channel-341507-f9ced127bbc394a491219030df464f3040a52f44f24d8fd34caf2f5793e7dcab with timetoken=13877951283212765
[2013-12-23 10:46:46,009] [17] [INFO ] [PubNubMessaging.Core.Pubnub] [(null)] [(null)] [(null)] - DateTime 23/12/2013 10:46:46, Request=http://pubsub.pubnub.com/subscribe/sub-c-f3158300-f382-11e2-b871-02ee2ddab7fe/private-member-channel-341507-f9ced127bbc394a491219030df464f3040a52f44f24d8fd34caf2f5793e7dcab/0/13877951283212765?uuid=63aa23d9-dfee-49cf-bbc6-f9b24e897ecc
[2013-12-23 10:46:46,010] [7] [ERROR] [PubNubMessaging.Core.Pubnub] [Test] [187700] [GetFileTree] - DateTime 23/12/2013 10:46:46 checkInternetStatus Error. System.Net.Sockets.SocketException: No such host is known
at System.Net.Dns.GetAddrInfo(String name)
at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
at System.Net.Dns.GetHostAddresses(String hostNameOrAddress)
at System.Net.Sockets.UdpClient.Connect(String hostname, Int32 port)
at PubNubMessaging.Core.ClientNetworkStatus.CheckSocketConnect(Object internetState)
[2013-12-23 10:46:46,011] [7] [INFO ] [PubNubMessaging.Core.Pubnub] [Test] [187700] [GetFileTree] - DateTime 23/12/2013 10:46:46 TerminatePendingWebRequest http://pubsub.pubnub.com/subscribe/sub-c-f3158300-f382-11e2-b871-02ee2ddab7fe/private-member-channel-341507-f9ced127bbc394a491219030df464f3040a52f44f24d8fd34caf2f5793e7dcab/0/13877951283212765?uuid=63aa23d9-dfee-49cf-bbc6-f9b24e897ecc
[2013-12-23 10:46:46,012] [17] [ERROR] [PubNubMessaging.Core.Pubnub] [(null)] [(null)] [(null)] - DateTime 23/12/2013 10:46:46, WebException: System.Net.WebException: The request was aborted: The request was canceled.
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at PubNubMessaging.Core.PubnubWebRequest.EndGetResponse(IAsyncResult asyncResult)
at PubNubMessaging.Core.Pubnub.UrlProcessResponseCallback[T](IAsyncResult asynchronousResult) for URL: http://pubsub.pubnub.com/subscribe/sub-c-f3158300-f382-11e2-b871-02ee2ddab7fe/private-member-channel-341507-f9ced127bbc394a491219030df464f3040a52f44f24d8fd34caf2f5793e7dcab/0/13877951283212765?uuid=63aa23d9-dfee-49cf-bbc6-f9b24e897ecc
[2013-12-23 10:46:46,012] [17] [INFO ] [PubNubMessaging.Core.Pubnub] [(null)] [(null)] [(null)] - DateTime 23/12/2013 10:46:46, Building request for channel(s)=private-member-channel-341507-f9ced127bbc394a491219030df464f3040a52f44f24d8fd34caf2f5793e7dcab with timetoken=13877951283212765
[2013-12-23 10:46:46,013] [17] [INFO ] [PubNubMessaging.Core.Pubnub] [(null)] [(null)] [(null)] - DateTime 23/12/2013 10:46:46, Request=http://pubsub.pubnub.com/subscribe/sub-c-f3158300-f382-11e2-b871-02ee2ddab7fe/private-member-channel-341507-f9ced127bbc394a491219030df464f3040a52f44f24d8fd34caf2f5793e7dcab/0/13877951283212765?uuid=63aa23d9-dfee-49cf-bbc6-f9b24e897ecc
[2013-12-23 10:46:46,013] [7] [ERROR] [PubNubMessaging.Core.Pubnub] [Test] [187700] [GetFileTree] - DateTime 23/12/2013 10:46:46 checkInternetStatus Error. System.Net.Sockets.SocketException: No such host is known
at System.Net.Dns.GetAddrInfo(String name)
at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
at System.Net.Dns.GetHostAddresses(String hostNameOrAddress)
at System.Net.Sockets.UdpClient.Connect(String hostname, Int32 port)
at PubNubMessaging.Core.ClientNetworkStatus.CheckSocketConnect(Object internetState)
I managed to get the process in the act of dying in the debugger and it was a stack overflow thru the excpetion handling MultiChannelSubscribeRequest. Which, I think, is what you would ultimately expect?
It might have been that it took several restore from hibernates to get there. The first restore will chew its way thru several recursion levels, and the network will become available, and it will work. User closes lid, and then on the next restore we recurse several more levels. It was also quite hard to repro. I never saw it in a VM environment, or using a BootCamp'd MacBook. I saw it after a couple of days on a Dell. So there is a a bit of guesswork, and basically removing the obvious 'error' when I hit it, rather than building a reproducible test case.
Apologises for the lack of precision,
Is there a test which randomly drop the network, maybe I can reproduce it by modifying one of those ..
from c-sharp.
Also, there are suspend fixes in 3.5, correct @budgetpreneur ?
from c-sharp.
There is some attempt at power management in 3.4.0.1 I believe
from c-sharp.
@DanielDignam
In PubNub 3.5, we have refactored code to improve machine suspend/awake feature. It will be released soon to NuGet along with new features PAM grant, audit.
In 3.5 example code, option 19 and 20 will enable us the simulation of machine sleep/awake modes; options 10 and 11 will enable us to enable/disable network simulation.
BTW...please let us know the environment(OS, .net framework) of your test.
You can also send email to PubNub Support for assistance.
from c-sharp.
@budgetpreneur in the meantime, @DanielDignam can test from here: https://github.com/pubnub/c-sharp/tree/master/csharp.net/3.5 , correct?
from c-sharp.
I've duplicated the issue. It's actually triggering when we go into suspend, maybe a race condition between receiving the suspend event and the network connection actually being powered down?
From the logfile I have this sequence, note we report (GrabCAD) report entering suspend, pubnub gets an exception, and then reports the entering suspend. The socket exception and webexception are what cascade the stack overflow.
[2014-01-06 20:51:18,439] [.NET SystemEvents] [INFO ] [GCAPI.GCApi] [(null)] [(null)] [(null)] - Entered Suspend power mode
[2014-01-06 20:51:18,485] [1] [ERROR] [PubNubMessaging.Core.Pubnub] [(null)] [(null)] [(null)] - DateTime 06/01/2014 20:51:18, WebException: System.Net.WebException: The request was aborted: The request was canceled.
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at PubNubMessaging.Core.PubnubWebRequest.EndGetResponse(IAsyncResult asyncResult)
at PubNubMessaging.Core.Pubnub.UrlProcessResponseCallback[T](IAsyncResult asynchronousResult) for URL: http://pubsub.pubnub.com/subscribe/sub-c-f3158300-f382-11e2-b871-02ee2ddab7fe/private-member-channel-341507-f9ced127bbc394a491219030df464f3040a52f44f24d8fd34caf2f5793e7dcab/0/13890412722848909?uuid=190be758-abb2-44d6-a5dc-41342dfa7c8a
[2014-01-06 20:51:18,491] [1] [INFO ] [PubNubMessaging.Core.Pubnub] [(null)] [(null)] [(null)] - DateTime 06/01/2014 20:51:18, Building request for channel(s)=private-member-channel-341507-f9ced127bbc394a491219030df464f3040a52f44f24d8fd34caf2f5793e7dcab with timetoken=13890412722848909
[2014-01-06 20:51:18,495] [1] [INFO ] [PubNubMessaging.Core.Pubnub] [(null)] [(null)] [(null)] - DateTime 06/01/2014 20:51:18, Request=http://pubsub.pubnub.com/subscribe/sub-c-f3158300-f382-11e2-b871-02ee2ddab7fe/private-member-channel-341507-f9ced127bbc394a491219030df464f3040a52f44f24d8fd34caf2f5793e7dcab/0/13890412722848909?uuid=190be758-abb2-44d6-a5dc-41342dfa7c8a
[2014-01-06 20:51:18,496] [1] [INFO ] [PubNubMessaging.Core.Pubnub] [(null)] [(null)] [(null)] - DateTime 06/01/2014 20:51:18 TerminatePendingWebRequest http://pubsub.pubnub.com/subscribe/sub-c-f3158300-f382-11e2-b871-02ee2ddab7fe/private-member-channel-341507-f9ced127bbc394a491219030df464f3040a52f44f24d8fd34caf2f5793e7dcab/0/13890412722848909?uuid=190be758-abb2-44d6-a5dc-41342dfa7c8a
[2014-01-06 20:51:18,496] [1] [INFO ] [PubNubMessaging.Core.Pubnub] [(null)] [(null)] [(null)] - DateTime 06/01/2014 20:51:18, System entered into Suspend Mode.
[2014-01-06 20:51:18,496] [1] [INFO ] [PubNubMessaging.Core.Pubnub] [(null)] [(null)] [(null)] - DateTime 06/01/2014 20:51:18, Disabled Timer for heartbeat
[2014-01-06 20:51:19,967] [7] [INFO ] [GCAPI.GCConnectionManager] [(null)] [(null)] [(null)] - isNetworkAvailable: False, isInternetConnected: False
[2014-01-06 20:57:47,516] [1] [DEBUG] [GrabCADDesktopClient.HandleAppUpdate] [(null)] [(null)] [(null)] - UpdateCheckTimer, checking
[2014-01-06 20:57:47,517] [1] [DEBUG] [GrabCADDesktopClient.HandleAppUpdate] [(null)] [(null)] [(null)] - CheckForUpdates called
[2014-01-06 20:57:47,517] [1] [DEBUG] [GrabCADDesktopClient.HandleAppUpdate] [(null)] [(null)] [(null)] - Skipping update check. Not needed yet
[2014-01-06 20:57:53,090] [18] [ERROR] [PubNubMessaging.Core.Pubnub] [(null)] [(null)] [(null)] - DateTime 06/01/2014 20:57:53 checkInternetStatus Error. System.Net.Sockets.SocketException: No such host is known
at System.Net.Dns.GetAddrInfo(String name)
at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
at System.Net.Dns.GetHostAddresses(String hostNameOrAddress)
at System.Net.Sockets.UdpClient.Connect(String hostname, Int32 port)
at PubNubMessaging.Core.ClientNetworkStatus.CheckSocketConnect(Object internetState)
[2014-01-06 20:57:53,108] [19] [ERROR] [PubNubMessaging.Core.Pubnub] [(null)] [(null)] [(null)] - DateTime 06/01/2014 20:57:53, WebException: System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A socket operation was attempted to an unreachable network 54.246.196.170:80
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at PubNubMessaging.Core.PubnubWebRequest.EndGetResponse(IAsyncResult asyncResult)
at PubNubMessaging.Core.Pubnub.UrlProcessResponseCallback[T](IAsyncResult asynchronousResult) for URL: http://pubsub.pubnub.com/subscribe/sub-c-f3158300-f382-11e2-b871-02ee2ddab7fe/private-member-channel-341507-f9ced127bbc394a491219030df464f3040a52f44f24d8fd34caf2f5793e7dcab/0/13890412722848909?uuid=190be758-abb2-44d6-a5dc-41342dfa7c8a
[2014-01-06 20:57:53,109] [19] [INFO ] [PubNubMessaging.Core.Pubnub] [(null)] [(null)] [(null)] - DateTime 06/01/2014 20:57:53, Building request for channel(s)=private-member-channel-341507-f9ced127bbc394a491219030df464f3040a52f44f24d8fd34caf2f5793e7dcab with timetoken=13890412722848909
[2014-01-06 20:57:53,110] [19] [INFO ] [PubNubMessaging.Core.Pubnub] [(null)] [(null)] [(null)] - DateTime 06/01/2014 20:57:53, Request=http://pubsub.pubnub.com/subscribe/sub-c-f3158300-f382-11e2-b871-02ee2ddab7fe/private-member-channel-341507-f9ced127bbc394a491219030df464f3040a52f44f24d8fd34caf2f5793e7dcab/0/13890412722848909?uuid=190be758-abb2-44d6-a5dc-41342dfa7c8a
[2014-01-06 20:57:53,110] [18] [INFO ] [PubNubMessaging.Core.Pubnub] [(null)] [(null)] [(null)] - DateTime 06/01/2014 20:57:53 TerminatePendingWebRequest http://pubsub.pubnub.com/subscribe/sub-c-f3158300-f382-11e2-b871-02ee2ddab7fe/private-member-channel-341507-f9ced127bbc394a491219030df464f3040a52f44f24d8fd34caf2f5793e7dcab/0/13890412722848909?uuid=190be758-abb2-44d6-a5dc-41342dfa7c8a
[2014-01-06 20:57:53,116] [8] [ERROR] [PubNubMessaging.Core.Pubnub] [] [] [(null)] - DateTime 06/01/2014 20:57:53 checkInternetStatus Error. System.Net.Sockets.SocketException: No such host is known
at System.Net.Dns.GetAddrInfo(String name)
at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
at System.Net.Dns.GetHostAddresses(String hostNameOrAddress)
at System.Net.Sockets.UdpClient.Connect(String hostname, Int32 port)
at PubNubMessaging.Core.ClientNetworkStatus.CheckSocketConnect(Object internetState)
[2014-01-06 20:57:53,126] [19] [ERROR] [PubNubMessaging.Core.Pubnub] [(null)] [(null)] [(null)] - DateTime 06/01/2014 20:57:53 Exception=System.Net.WebException: The request was aborted: The request was canceled.
at System.Net.HttpWebRequest.BeginGetResponse(AsyncCallback callback, Object state)
at PubNubMessaging.Core.PubnubWebRequest.BeginGetResponse(AsyncCallback callback, Object state)
at PubNubMessaging.Core.Pubnub.UrlProcessRequest[T](Uri requestUri, RequestState`1 pubnubRequestState)
mscorlib.dll!System.Diagnostics.StackTrace.ToString(System.Diagnostics.StackTrace.TraceFormat traceFormat) + 0x65 bytes
mscorlib.dll!System.Exception.StackTrace.get() + 0x4a bytes
mscorlib.dll!System.Exception.ToString() + 0x7c bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.UrlProcessRequest<System.__Canon>(System.Uri requestUri, PubNubMessaging.Core.RequestState<System.__Canon> pubnubRequestState) + 0xd3e bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.MultiChannelSubscribeRequest<string>(PubNubMessaging.Core.ResponseType type, string[] channels, object timetoken, System.Action<string> userCallback, System.Action<string> connectCallback, bool reconnect) + 0xb5b bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.MultiplexInternalCallback<string>(PubNubMessaging.Core.ResponseType type, object multiplexResult, System.Action<string> userCallback, System.Action<string> connectCallback) + 0x459 bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.MultiplexExceptionHandler<string>(PubNubMessaging.Core.ResponseType type, string[] channels, System.Action<string> userCallback, System.Action<string> connectCallback, bool reconnectMaxTried, bool resumeOnReconnect) + 0xc03 bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.UrlRequestCommonExceptionHandler<string>(PubNubMessaging.Core.ResponseType type, string[] channels, bool requestTimeout, System.Action<string> userCallback, System.Action<string> connectCallback, bool resumeOnReconnect) + 0xbc bytes
...
GCAPI.dll!PubNubMessaging.Core.Pubnub.UrlProcessRequest<System.__Canon>(System.Uri requestUri, PubNubMessaging.Core.RequestState<System.__Canon> pubnubRequestState) + 0xe0c bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.MultiChannelSubscribeRequest<string>(PubNubMessaging.Core.ResponseType type, string[] channels, object timetoken, System.Action<string> userCallback, System.Action<string> connectCallback, bool reconnect) + 0xb5b bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.MultiplexInternalCallback<string>(PubNubMessaging.Core.ResponseType type, object multiplexResult, System.Action<string> userCallback, System.Action<string> connectCallback) + 0x459 bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.MultiplexExceptionHandler<string>(PubNubMessaging.Core.ResponseType type, string[] channels, System.Action<string> userCallback, System.Action<string> connectCallback, bool reconnectMaxTried, bool resumeOnReconnect) + 0xc03 bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.UrlRequestCommonExceptionHandler<string>(PubNubMessaging.Core.ResponseType type, string[] channels, bool requestTimeout, System.Action<string> userCallback, System.Action<string> connectCallback, bool resumeOnReconnect) + 0xbc bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.ProcessResponseCallbackWebExceptionHandler<string>(System.Net.WebException webEx, PubNubMessaging.Core.RequestState<string> asynchRequestState, string channel) + 0xcae bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.UrlProcessResponseCallback<System.__Canon>(System.IAsyncResult asynchronousResult) + 0xd9f bytes
System.dll!System.Net.LazyAsyncResult.Complete(System.IntPtr userToken) + 0xbe bytes
System.dll!System.Net.ContextAwareResult.CaptureOrComplete(ref System.Threading.ExecutionContext cachedContext, bool returnContext) + 0x148 bytes
System.dll!System.Net.ContextAwareResult.FinishPostingAsyncOp() + 0x3c bytes
System.dll!System.Net.HttpWebRequest.BeginGetResponse(System.AsyncCallback callback, object state) + 0x2e7 bytes
GCAPI.dll!PubNubMessaging.Core.PubnubWebRequest.BeginGetResponse(System.AsyncCallback callback, object state) + 0xe9 bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.UrlProcessRequest<string>(System.Uri requestUri, PubNubMessaging.Core.RequestState<string> pubnubRequestState) + 0xbb0 bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.MultiChannelSubscribeRequest<string>(PubNubMessaging.Core.ResponseType type, string[] channels, object timetoken, System.Action<string> userCallback, System.Action<string> connectCallback, bool reconnect) + 0xb5b bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.MultiplexInternalCallback<string>(PubNubMessaging.Core.ResponseType type, object multiplexResult, System.Action<string> userCallback, System.Action<string> connectCallback) + 0x459 bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.MultiplexExceptionHandler<string>(PubNubMessaging.Core.ResponseType type, string[] channels, System.Action<string> userCallback, System.Action<string> connectCallback, bool reconnectMaxTried, bool resumeOnReconnect) + 0xc03 bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.UrlRequestCommonExceptionHandler<string>(PubNubMessaging.Core.ResponseType type, string[] channels, bool requestTimeout, System.Action<string> userCallback, System.Action<string> connectCallback, bool resumeOnReconnect) + 0xbc bytes
....
GCAPI.dll!PubNubMessaging.Core.Pubnub.UrlProcessRequest<System.__Canon>(System.Uri requestUri, PubNubMessaging.Core.RequestState<System.__Canon> pubnubRequestState) + 0xe0c bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.MultiChannelSubscribeRequest<string>(PubNubMessaging.Core.ResponseType type, string[] channels, object timetoken, System.Action<string> userCallback, System.Action<string> connectCallback, bool reconnect) + 0xb5b bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.MultiplexInternalCallback<string>(PubNubMessaging.Core.ResponseType type, object multiplexResult, System.Action<string> userCallback, System.Action<string> connectCallback) + 0x459 bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.MultiplexExceptionHandler<string>(PubNubMessaging.Core.ResponseType type, string[] channels, System.Action<string> userCallback, System.Action<string> connectCallback, bool reconnectMaxTried, bool resumeOnReconnect) + 0xc03 bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.UrlRequestCommonExceptionHandler<string>(PubNubMessaging.Core.ResponseType type, string[] channels, bool requestTimeout, System.Action<string> userCallback, System.Action<string> connectCallback, bool resumeOnReconnect) + 0xbc bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.UrlProcessRequest<System.__Canon>(System.Uri requestUri, PubNubMessaging.Core.RequestState<System.__Canon> pubnubRequestState) + 0xe0c bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.MultiChannelSubscribeRequest<string>(PubNubMessaging.Core.ResponseType type, string[] channels, object timetoken, System.Action<string> userCallback, System.Action<string> connectCallback, bool reconnect) + 0xb5b bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.MultiplexInternalCallback<string>(PubNubMessaging.Core.ResponseType type, object multiplexResult, System.Action<string> userCallback, System.Action<string> connectCallback) + 0x459 bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.MultiplexExceptionHandler<string>(PubNubMessaging.Core.ResponseType type, string[] channels, System.Action<string> userCallback, System.Action<string> connectCallback, bool reconnectMaxTried, bool resumeOnReconnect) + 0xc03 bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.UrlRequestCommonExceptionHandler<string>(PubNubMessaging.Core.ResponseType type, string[] channels, bool requestTimeout, System.Action<string> userCallback, System.Action<string> connectCallback, bool resumeOnReconnect) + 0xbc bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.ProcessResponseCallbackWebExceptionHandler<string>(System.Net.WebException webEx, PubNubMessaging.Core.RequestState<string> asynchRequestState, string channel) + 0xcae bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.UrlProcessResponseCallback<System.__Canon>(System.IAsyncResult asynchronousResult) + 0xd9f bytes
System.dll!System.Net.LazyAsyncResult.Complete(System.IntPtr userToken) + 0xbe bytes
System.dll!System.Net.ContextAwareResult.CaptureOrComplete(ref System.Threading.ExecutionContext cachedContext, bool returnContext) + 0x148 bytes
System.dll!System.Net.ContextAwareResult.FinishPostingAsyncOp() + 0x3c bytes
System.dll!System.Net.HttpWebRequest.BeginGetResponse(System.AsyncCallback callback, object state) + 0x2e7 bytes
GCAPI.dll!PubNubMessaging.Core.PubnubWebRequest.BeginGetResponse(System.AsyncCallback callback, object state) + 0xe9 bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.UrlProcessRequest<string>(System.Uri requestUri, PubNubMessaging.Core.RequestState<string> pubnubRequestState) + 0xbb0 bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.MultiChannelSubscribeRequest<string>(PubNubMessaging.Core.ResponseType type, string[] channels, object timetoken, System.Action<string> userCallback, System.Action<string> connectCallback, bool reconnect) + 0xb5b bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.MultiplexInternalCallback<string>(PubNubMessaging.Core.ResponseType type, object multiplexResult, System.Action<string> userCallback, System.Action<string> connectCallback) + 0x459 bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.MultiplexExceptionHandler<string>(PubNubMessaging.Core.ResponseType type, string[] channels, System.Action<string> userCallback, System.Action<string> connectCallback, bool reconnectMaxTried, bool resumeOnReconnect) + 0xc03 bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.UrlRequestCommonExceptionHandler<string>(PubNubMessaging.Core.ResponseType type, string[] channels, bool requestTimeout, System.Action<string> userCallback, System.Action<string> connectCallback, bool resumeOnReconnect) + 0xbc bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.UrlProcessRequest<System.__Canon>(System.Uri requestUri, PubNubMessaging.Core.RequestState<System.__Canon> pubnubRequestState) + 0xe0c bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.MultiChannelSubscribeRequest<string>(PubNubMessaging.Core.ResponseType type, string[] channels, object timetoken, System.Action<string> userCallback, System.Action<string> connectCallback, bool reconnect) + 0xb5b bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.MultiplexInternalCallback<string>(PubNubMessaging.Core.ResponseType type, object multiplexResult, System.Action<string> userCallback, System.Action<string> connectCallback) + 0x459 bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.MultiplexExceptionHandler<string>(PubNubMessaging.Core.ResponseType type, string[] channels, System.Action<string> userCallback, System.Action<string> connectCallback, bool reconnectMaxTried, bool resumeOnReconnect) + 0xc03 bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.UrlRequestCommonExceptionHandler<string>(PubNubMessaging.Core.ResponseType type, string[] channels, bool requestTimeout, System.Action<string> userCallback, System.Action<string> connectCallback, bool resumeOnReconnect) + 0xbc bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.UrlProcessRequest<System.__Canon>(System.Uri requestUri, PubNubMessaging.Core.RequestState<System.__Canon> pubnubRequestState) + 0xe0c bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.MultiChannelSubscribeRequest<string>(PubNubMessaging.Core.ResponseType type, string[] channels, object timetoken, System.Action<string> userCallback, System.Action<string> connectCallback, bool reconnect) + 0xb5b bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.MultiplexInternalCallback<string>(PubNubMessaging.Core.ResponseType type, object multiplexResult, System.Action<string> userCallback, System.Action<string> connectCallback) + 0x459 bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.MultiplexExceptionHandler<string>(PubNubMessaging.Core.ResponseType type, string[] channels, System.Action<string> userCallback, System.Action<string> connectCallback, bool reconnectMaxTried, bool resumeOnReconnect) + 0xc03 bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.UrlRequestCommonExceptionHandler<string>(PubNubMessaging.Core.ResponseType type, string[] channels, bool requestTimeout, System.Action<string> userCallback, System.Action<string> connectCallback, bool resumeOnReconnect) + 0xbc bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.ProcessResponseCallbackWebExceptionHandler<string>(System.Net.WebException webEx, PubNubMessaging.Core.RequestState<string> asynchRequestState, string channel) + 0xcae bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.UrlProcessResponseCallback<System.__Canon>(System.IAsyncResult asynchronousResult) + 0xd9f bytes
System.dll!System.Net.LazyAsyncResult.Complete(System.IntPtr userToken) + 0xbe bytes
System.dll!System.Net.ContextAwareResult.CaptureOrComplete(ref System.Threading.ExecutionContext cachedContext, bool returnContext) + 0x148 bytes
System.dll!System.Net.ContextAwareResult.FinishPostingAsyncOp() + 0x3c bytes
System.dll!System.Net.HttpWebRequest.BeginGetResponse(System.AsyncCallback callback, object state) + 0x2e7 bytes
GCAPI.dll!PubNubMessaging.Core.PubnubWebRequest.BeginGetResponse(System.AsyncCallback callback, object state) + 0xe9 bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.UrlProcessRequest<string>(System.Uri requestUri, PubNubMessaging.Core.RequestState<string> pubnubRequestState) + 0xbb0 bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.MultiChannelSubscribeRequest<string>(PubNubMessaging.Core.ResponseType type, string[] channels, object timetoken, System.Action<string> userCallback, System.Action<string> connectCallback, bool reconnect) + 0xb5b bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.MultiplexInternalCallback<string>(PubNubMessaging.Core.ResponseType type, object multiplexResult, System.Action<string> userCallback, System.Action<string> connectCallback) + 0x459 bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.MultiplexExceptionHandler<string>(PubNubMessaging.Core.ResponseType type, string[] channels, System.Action<string> userCallback, System.Action<string> connectCallback, bool reconnectMaxTried, bool resumeOnReconnect) + 0xc03 bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.UrlRequestCommonExceptionHandler<string>(PubNubMessaging.Core.ResponseType type, string[] channels, bool requestTimeout, System.Action<string> userCallback, System.Action<string> connectCallback, bool resumeOnReconnect) + 0xbc bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.ProcessResponseCallbackWebExceptionHandler<string>(System.Net.WebException webEx, PubNubMessaging.Core.RequestState<string> asynchRequestState, string channel) + 0xcae bytes
GCAPI.dll!PubNubMessaging.Core.Pubnub.UrlProcessResponseCallback<System.__Canon>(System.IAsyncResult asynchronousResult) + 0xd9f bytes
System.dll!System.Net.LazyAsyncResult.Complete(System.IntPtr userToken) + 0xbe bytes
mscorlib.dll!System.Threading.ExecutionContext.runTryCode(object userData) + 0x178 bytes
[Native to Managed Transition]
[Managed to Native Transition]
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x62 bytes
System.dll!System.Net.ContextAwareResult.Complete(System.IntPtr userToken) + 0xcb bytes
System.dll!System.Net.LazyAsyncResult.ProtectedInvokeCallback(object result, System.IntPtr userToken) + 0xc3 bytes
System.dll!System.Net.HttpWebRequest.SetResponse(System.Exception E) + 0x620 bytes
System.dll!System.Net.ConnectionReturnResult.SetResponses(System.Net.ConnectionReturnResult returnResult) + 0xbb bytes
System.dll!System.Net.Connection.CompleteConnectionWrapper(object request, object state) + 0x70 bytes
System.dll!System.Net.PooledStream.ConnectionCallback(object owningObject, System.Exception e, System.Net.Sockets.Socket socket, System.Net.IPAddress address) + 0x83 bytes
System.dll!System.Net.ServicePoint.ConnectSocketCallback(System.IAsyncResult asyncResult) + 0x1bc bytes
System.dll!System.Net.LazyAsyncResult.Complete(System.IntPtr userToken) + 0xbe bytes
System.dll!System.Net.ContextAwareResult.Complete(System.IntPtr userToken) + 0x3b bytes
System.dll!System.Net.LazyAsyncResult.ProtectedInvokeCallback(object result, System.IntPtr userToken) + 0xc3 bytes
System.dll!System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(uint errorCode, uint numBytes, System.Threading.NativeOverlapped* nativeOverlapped) + 0x132 bytes
mscorlib.dll!System.Threading._IOCompletionCallback.PerformIOCompletionCallback(uint errorCode, uint numBytes, System.Threading.NativeOverlapped* pOVERLAP) + 0xce bytes
from c-sharp.
@DanielDignam ,
Would you mind to let us know the machine environment like OS, .net framework version.
In your original post, you indicated "..replaced it in our app with a simple loop, and the chap seeing the error has reported no more problems". Do you mind to share that simple loop logic which you reported "no more problems". I would like to see if there will be any impact or side-effects, before I incorporate it in our next release.
Thanking you.
from c-sharp.
@DanielDignam also, was this repro'd on 3.4 or 3.5 ?
from c-sharp.
I duplicated the issue on a Dell XPS 13 running Windows 8.1, the application is running against .NET 3.5, report came from a Dell running Windows 7, we're using 3.4.0.1.
I'm guessing I should put a pull request together ?
I'm looking into it some more, the stack I posted above would not be fixed by my change,
from c-sharp.
@DanielDignam
I would recommend you try the version from https://github.com/pubnub/c-sharp/tree/master/csharp.net/3.5, which is much improved than 3.4.0.1. You can also try unlisted NuGet pre-release version 3.5.0.1-rc6 by executing the following command in your package manager console.
Install-Package Pubnub -Version 3.5.0.1-rc6 -Pre
Please let us know how 3.5 from Git or Nuget 3.5.0.1-rc6 behaved on your win 8.1 machine.
from c-sharp.
@DanielDignam specifically in 3.5, we've made suspend/resume fixes, so its important to see if the issue still exists in this version please.
geremy
from c-sharp.
I'll giive 3.5.0.1-rc6 a go and keep you posted. Thanks for all the help !
from c-sharp.
Tried 3.5 (got by a git clone), and hit a null reference exception on suspend:, this is because TerminatePendingWebRequest passes null as the state to TerminatePendingWebRequest
> GCAPI.dll!PubNubMessaging.Core.Pubnub.TerminatePendingWebRequest<object>(PubNubMessaging.Core.RequestState<object> state) Line 661 + 0x7 bytes C#
GCAPI.dll!PubNubMessaging.Core.Pubnub.TerminatePendingWebRequest() Line 623 + 0x17 bytes C#
GCAPI.dll!PubNubMessaging.Core.Pubnub.SystemEvents_PowerModeChanged(object sender, Microsoft.Win32.PowerModeChangedEventArgs e) Line 583 + 0xc bytes C#
[Native to Managed Transition]
[Managed to Native Transition]
mscorlib.dll!System.Delegate.DynamicInvokeImpl(object[] args) + 0x73 bytes
System.dll!Microsoft.Win32.SystemEvents.SystemEventInvokeInfo.InvokeCallback(object arg) + 0x24 bytes
WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, bool isSingleParameter) + 0x1a7 bytes
WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.TryCatchWhen(object source, System.Delegate callback, object args, bool isSingleParameter, System.Delegate catchHandler) + 0x4c bytes
WindowsBase.dll!System.Windows.Threading.DispatcherOperation.InvokeImpl() + 0xc0 bytes
mscorlib.dll!System.Threading.ExecutionContext.runTryCode(object userData) + 0x178 bytes
[Native to Managed Transition]
[Managed to Native Transition]
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x62 bytes
WindowsBase.dll!System.Windows.Threading.DispatcherOperation.Invoke() + 0x6a bytes
WindowsBase.dll!System.Windows.Threading.Dispatcher.ProcessQueue() + 0x2b0 bytes
WindowsBase.dll!System.Windows.Threading.Dispatcher.WndProcHook(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) + 0xb4 bytes
WindowsBase.dll!MS.Win32.HwndWrapper.WndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) + 0xce bytes
WindowsBase.dll!MS.Win32.HwndSubclass.DispatcherCallbackOperation(object o) + 0x96 bytes
WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, bool isSingleParameter) + 0xec bytes
WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.TryCatchWhen(object source, System.Delegate callback, object args, bool isSingleParameter, System.Delegate catchHandler) + 0x4c bytes
WindowsBase.dll!System.Windows.Threading.Dispatcher.InvokeImpl(System.Windows.Threading.DispatcherPriority priority, System.TimeSpan timeout, System.Delegate method, object args, bool isSingleParameter) + 0xde bytes
WindowsBase.dll!MS.Win32.HwndSubclass.SubclassWndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam) + 0x177 bytes
[Native to Managed Transition]
[Managed to Native Transition]
WindowsBase.dll!System.Windows.Threading.Dispatcher.TranslateAndDispatchMessage(ref System.Windows.Interop.MSG msg) + 0x46 bytes
WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame frame) + 0xf1 bytes
PresentationFramework.dll!System.Windows.Application.RunInternal(System.Windows.Window window) + 0xb7 bytes
GrabCADDesktopClient.exe!GrabCADDesktopClient.App.Main() Line 35 + 0x10 bytes C#
[Native to Managed Transition]
[Managed to Native Transition]
mscorlib.dll!System.Runtime.Hosting.ApplicationActivator.CreateInstance(System.ActivationContext activationContext, string[] activationCustomData) + 0xa6 bytes
Microsoft.VisualStudio.HostingProcess.Utilities.dll!Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone() + 0x2e bytes
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x9b bytes
mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() + 0x4d bytes
private void TerminatePendingWebRequest()
{
TerminatePendingWebRequest<object>(null);
}
private void TerminatePendingWebRequest<T>(RequestState<T> state)
{
if (state != null && state.Request != null)
{
if (state.Channels != null && state.Channels.Length > 0)
{
string activeChannel = state.Channels[0].ToString(); //Assuming one channel exist, else will refactor later
PubnubChannelCallbackKey callbackKey = new PubnubChannelCallbackKey();
callbackKey.Channel = (state.Type == ResponseType.Subscribe) ? activeChannel.Replace("-pnpres", "") : activeChannel;
callbackKey.Type = state.Type;
if (_channelCallbacks.Count > 0 && _channelCallbacks.ContainsKey(callbackKey))
{
object callbackObject;
bool channelAvailable = _channelCallbacks.TryGetValue(callbackKey, out callbackObject);
PubnubChannelCallback<T> currentPubnubCallback = null;
if (channelAvailable)
{
currentPubnubCallback = callbackObject as PubnubChannelCallback<T>;
}
if (currentPubnubCallback != null && currentPubnubCallback.ErrorCallback != null)
{
state.Request.Abort(currentPubnubCallback.ErrorCallback, errorLevel);
}
}
}
}
else
{
ICollection<string> keyCollection = _channelRequest.Keys;
foreach (string key in keyCollection)
{
PubnubWebRequest currentRequest = _channelRequest[key];
if (currentRequest != null)
{
TerminatePendingWebRequest(currentRequest, state.ErrorCallback);
from c-sharp.
@DanielDignam ,
TerminatePendingWebRequest(RequestState state) expects null value to terminate any pending subscribe/presence requests. So when state = null, we run else part of the if condition. Basically when state = null, we are retrieving key collection and terminating any available pending pubnub web requests. Could you be more specific where null reference exception was raised because I did not see null reference exception in the provided log. Also please let me know if you still notice "stack overflow" with 3.5 when machine goes to suspend mode.
from c-sharp.
If there is a currentRequest isn't a null reference exception pretty much guaranteed if state is null. We will take the else, and then try and access state.ErrorCallback ? That was were I saw the exception
private void TerminatePendingWebRequest()
{
TerminatePendingWebRequest<object>(null);
}
private void TerminatePendingWebRequest<T>(RequestState<T> state)
{
if (state != null && state.Request != null)
{
...
}
else
{
ICollection<string> keyCollection = _channelRequest.Keys;
foreach (string key in keyCollection)
{
PubnubWebRequest currentRequest = _channelRequest[key];
if (currentRequest != null)
{
TerminatePendingWebRequest(currentRequest, state.ErrorCallback);
}
}
}
}
from c-sharp.
Got it. Will look into that to fix it.
from c-sharp.
@DanielDignam
Thank you for your input.
Fix was made to handle null and it is available at https://github.com/pubnub/c-sharp/blob/PN-513/csharp.net/3.5/PubNub-Messaging/Pubnub.cs#L647.
You can get fix from branch PN-513 or replace "state.ErrorCallback" in line# 647 with null.
We will release to master as soon as possible.
Also can you please confirm if stack overflow issue is resolved or not.
from c-sharp.
Thx, I'll apply the replace fix and continue testing.
from c-sharp.
Looking good, I'll do a little more testing tonight, and push so I can get some internal testing.
Thx for all the help
from c-sharp.
@DanielDignam how is this looking for you ?
from c-sharp.
Sorry for not getting back to you, it's looking good
from c-sharp.
Np, let us know if you have any other questions at [email protected] !
from c-sharp.
Related Issues (16)
- readme.md: how to do this? HOT 2
- The sdk retries in 403s leading to huge billings.
- Possible memory leak when used with ASP.NET Core DI HOT 2
- "Spaces" and "AuthorizedUserId" are not considered when granting token
- PubNub service stops listening after a few days HOT 1
- PubNub memory leak detected
- PubNub doesn't work on physical device HOT 11
- Nuget 6.19.4 having issue with issue with **DECRYPT ERROR** on FetchHistory
- CleanupTelemetryData Taking Too Much CPU/Memory
- Occasional failure to connect when using multiple Subscribe + Execute invocations
- Presence sends leave event for old subscribed channels when subscribing to different new channels
- Use proper preprocessor directives for Mono for Android and iOS HOT 3
- v3.5 Released
- Do a proper lib in the NuGet package HOT 1
- Pubnub C# api "self conflict" HOT 10
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 c-sharp.