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

There is a big problem in fluentscheduler library!!! #130

Closed
lampo1024 opened this issue Dec 30, 2016 · 5 comments
Closed

There is a big problem in fluentscheduler library!!! #130

lampo1024 opened this issue Dec 30, 2016 · 5 comments

Comments

@lampo1024
Copy link

lampo1024 commented Dec 30, 2016

I have used "FluentScheduler" library in some of my projects,It works fine all the time.But there is a big problem in my latest winform project recently , and the whole winform application crashed. I catched the exception as follows:

System.InvalidOperationException: Collection was modified; enumeration operation may not execute.    
at System.Collections.Generic.HashSet`1.Enumerator.MoveNext()     
at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)     
at FluentScheduler.JobManager.RunJob(Schedule schedule)     
at FluentScheduler.JobManager.ScheduleJobs()     
at FluentScheduler.JobManager.ScheduleJobs()    
at FluentScheduler.JobManager.ScheduleJobs()     
at FluentScheduler.JobManager.ScheduleJobs()     
at FluentScheduler.JobManager.<>c.<.cctor>b__40_0(Object state)     
at System.Threading.TimerQueueTimer.CallCallbackInContext(Object state)    
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)    
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)     
at System.Threading.TimerQueueTimer.CallCallback()     
at System.Threading.TimerQueueTimer.Fire()     
at System.Threading.TimerQueue.FireNextTimers()     
at System.Threading.TimerQueue.AppDomainTimerCallback()
@tallesl
Copy link
Contributor

tallesl commented Jan 2, 2017

I don't know why you closed the issue (mistake?) but you found a pretty nasty bug alright, thank you for reporting.

Calling Any when there's a potential Remove call from another task plus Add not being thread-safe (as probably the Remove call). Those were really bad mistakes on my part, I apologize for that.

Looks like the fix is easy to apply (just good old lock for now). I'm publishing a new version ASAP.

@lampo1024 lampo1024 reopened this Jan 3, 2017
@lampo1024
Copy link
Author

lampo1024 commented Jan 3, 2017

Thank you for replying.
Because nobody answered me since I reported the problem, so I closed the issue.
Please fix it ASAP , cause I'm using "FluentScheduler" in my production environment.

@cuiwenyuan
Copy link

@lampo1024 You did great job - big bug!

FluentScheduler is open sourced, this doesn't mean you can force the team to fix the bug as your expection.

@lampo1024
Copy link
Author

@cuiwenyuan Yes, I known that.But I don't want to fix the bug by modifying the source code directly,cause It's hard to keep in step with offical version.

@tallesl tallesl closed this as completed in 664024b Jan 3, 2017
@tallesl
Copy link
Contributor

tallesl commented Jan 3, 2017

Fixed on 5.1.3.

Sorry once again folks.

@tallesl tallesl mentioned this issue Sep 4, 2018
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

3 participants