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

Missing try-catch blocks on using ThreadPool.QueueUserWorkItem #94

Open
yasemindeki opened this issue Dec 11, 2015 · 1 comment
Open

Comments

@yasemindeki
Copy link

Hi,
I have been using 2.4.2 version of Twitterizer API. Our application has closed unexpectedly because of Twitterizer.Streaming.TwitterStream.ParseMessage. The stack message is:

Application: Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: Newtonsoft.Json.JsonSerializationException Stack: at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(Newtonsoft.Json.JsonReader, System.Type, Boolean) at Newtonsoft.Json.JsonSerializer.DeserializeInternal(Newtonsoft.Json.JsonReader, System.Type) at Newtonsoft.Json.JsonConvert.DeserializeObject[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.String, Newtonsoft.Json.JsonSerializerSettings) at

Twitterizer.Streaming.TwitterStream.ParseMessage(System.String) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

I've realized the method TwitterStream.StreamCallback has a call of ThreadPool.QueueUserWorkItem. But ParseMessage does not have try-catch block. I've added the block in our project. I hope you will fix it then deploy.

Thanks so much to you for this valuable API. I wish you success.
Best regards,

Note: The following links explains why we need try-catch blocks on using ThreadPool.QueueUserWorkItem:

http://forums.asp.net/t/1742425.aspx?try+catch+not+catching+timeout
http://paulstovell.com/blog/threadpool-vs-tasks

@SeanFarrow
Copy link
Contributor

Hi,

Can you fork this and send a pull request?

From: yasemindeki [mailto:notifications@github.com]
Sent: 11 December 2015 12:50
To: Twitterizer/Twitterizer Twitterizer@noreply.github.com
Subject: [Twitterizer] Missing try-catch blocks on using ThreadPool.QueueUserWorkItem (#94)

Hi,
I have been using 242 version of Twitterizer API Our application has closed unexpectedly because of TwitterizerStreamingTwitterStreamParseMessage The stack message is:

Application:

Framework Version: v4030319
Description: The process was terminated due to an unhandled exception
Exception Info: NewtonsoftJsonJsonSerializationException Stack: at NewtonsoftJsonSerializationJsonSerializerInternalReaderDeserialize(NewtonsoftJsonJsonReader, SystemType, Boolean) at NewtonsoftJsonJsonSerializerDeserializeInternal(NewtonsoftJsonJsonReader, SystemType) at NewtonsoftJsonJsonConvertDeserializeObject[System__Canon, mscorlib, Version=4000, Culture=neutral, PublicKeyToken=b77a5c561934e089]<SystemString,%20NewtonsoftJsonJsonSerializerSettings> at

TwitterizerStreamingTwitterStreamParseMessage(SystemString) at SystemThreadingExecutionContextRun(SystemThreadingExecutionContext, SystemThreadingContextCallback, SystemObject, Boolean) at SystemThreadingQueueUserWorkItemCallbackSystemThreadingIThreadPoolWorkItemExecuteWorkItem() at SystemThreadingThreadPoolWorkQueueDispatch() at SystemThreading_ThreadPoolWaitCallbackPerformWaitCallback()

I've realized the method TwitterStreamStreamCallback has a call of ThreadPoolQueueUserWorkItem But ParseMessage does not have try-catch block I've added the block in our project I hope you will fix it then deploy

Thanks so much to you for this valuable API I wish you success
Best regards,

Note: The following links explains why we need try-catch blocks on using ThreadPoolQueueUserWorkItem:

http://forumsaspnet/t/1742425aspx?try+catch+not+catching+timeout
http://paulstovellcom/blog/threadpool-vs-tasks


Reply to this email directly or view it on GitHubhttps://github.com//issues/94.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants