-
Notifications
You must be signed in to change notification settings - Fork 98
Fixed issue #254 - auto "fireuping" sup-config, if there are no any configured sources #358
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
base: develop
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -152,10 +152,18 @@ end | |
| module_function :start_cursing, :stop_cursing | ||
|
|
||
| Index.init | ||
| Index.lock_interactively or exit | ||
|
|
||
| begin | ||
| Redwood::start | ||
| Redwood::SourceManager.load_sources | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this not done twice now (in case of configured)? |
||
|
|
||
| if Redwood::SourceManager.sources.empty? | ||
| debug "No sources found!" | ||
| exec("sup-config") | ||
| abort | ||
| end | ||
|
|
||
| Index.lock_interactively or exit | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see you have moved it down here, this might be ok. But this is after Redwood::start, and requires extensive testing.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have tested this solution on two kinds of email sources and it worked. I don't see any problem there, everything should work as expected.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You change the time of mail index locking, this might have other On Tue, Dec 30, 2014 at 1:05 PM, Tymon Radzik notifications@github.com
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It wasn't there, but on about 6 tests I it worked I expected. If see any issue there, please give me exact example, where is error.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I second @gauteh's question: Why the locking needed to be moved? Apparently you had a good reason to do it. Otherwise you wouldn't have done it, right? So, please share the rationale with us and we'll understand too. Of course no errors have been triaged that have this move-of-locking as root cause. The point is, however, that as a general rule, one should be conservative in making changes to avoid ripple effects. If there's no gain from the change, why take the potential risk of breaking things in subtle ways which we may only find out later on the hard way?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @terotil As I saw, locking-index could cause problems, when running with sup-config. Espetically, when index is in bad version... That's why I moved this option after my if. Risk is minimal there, it is tested, I think it is unlikely possible to be anye errors there
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ty221 I see. How about releasing the lock before I think starting the initialization procedure without locking index is bad idea in principle and I'd like to see that sequence not to be touched because of smoother exception handling.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That might be good idea. I will try to implement it @terotil . |
||
| Index.load | ||
| Redwood::check_syncback_settings | ||
| Index.start_sync_worker unless $opts[:no_threads] | ||
|
|
@@ -432,5 +440,4 @@ EOS | |
| puts e.message, e.backtrace | ||
| end | ||
| end | ||
|
|
||
| end | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you doing this? Make sure you understand all the implications of the changes you are doing as well as testing it. Changing this line is not something you do without careful thought and a good overview of how sup works.