Merged
Conversation
Since job, stage and config can change simultaneously, put in a queue to multiplex all their calls onto their own handlers, running on a single thread. That way, the cache does not need to have very strong concurrency semantics. It'll need to be a single-thread-write and multi-thread-read.
* Move relevant code from CcTrayStatus#jobStatusChanged and dependencies to CcTrayJobStatusChangeHandler.
* Move relevant code from CcTrayStatus#stageStatusChanged and dependencies to CcTrayStageStatusChangeHandler.
Change the interface of CcTrayJobStatusChangeHandler so that it can be used by the config change handler too, since it needs to convert Job instances to ProjectStatus.
Change the interface of CcTrayStageStatusChangeHandler so that it can be used by the config change handler too, since it needs to convert Job instances to ProjectStatus.
* Stages already in cache are used. * If they're not in the cache, then the DB is queried. * If a stage in not in DB as well (never run), then a dummy stage status is used. * Handles new jobs in config (converted to dummy state) and removed jobs (removes from cache).
Breakers are calculated as before. This is almost a full migration from CcTrayStatus#computeBreakersIfStageFailed to CcTrayBreakersCalculator.
Almost a migration from old CcTrayStatusService#initializeMissingStages method to CcTrayStageStatusLoader.
CcTrayStageStatusLoader needs to load a stage from DB. But, it causes a circular dependency if it uses StageService, because StageService needs all StageStatusListener objects during construction. CcTrayActivityListener is a StageStatusListener, which depends on CcTrayStageStatusChangeHandler, which is a dependency of CcTrayStageStatusLoader (circular).
Flattens out group and superadmin user and role permissions into a map of pipeline groups to the set of users who can view them.
Depending on the view permissions of the pipeline group, update each CcTray project status with the viewers, so that they need not be checked every time.
Prevents config from having to be iterated on, to get projects.
* Consider user permissions (who has access to a pipeline). * Generate XML and cache parts when possible.
Unlike the job and stage status change listeners, the config change listener requires explicit registration. Hook up CcTrayListener to ApplicationInitializer, to guarantee order of registration.
When a job or stage changes, the cache is updated with the new status. But, the orderedEntries list was not updated, since it was maintained externally. Now, use a LinkedHashMap to to maintain order.
When a job or stage status changes, the existing view permissions in cache should be preserved. That information changes only when config changes.
* The CcTrayActivityListener queue processor is now started during initialize. Otherwise, it won't process anything. * Also, mark the orderedEntries field in CcTrayCache as volatile, since it is accessed by multiple threads and changed by one.
* Provide route in Rails to new_cctray.xml (temporary route name). * Use context and request paths to decide on correct prefix (as was done with old CCTray requests).
A value passed to localize was nil. Set it to a valid value in the spec.
Member
Author
|
Personal build is green: go/pipelines/value_stream_map/personal-arvind/7 on 05. |
Within the same class. public methods up. private methods down.
Without this change, it redirects to login page. Compare: curl -I 'http://localhost:8153/go/cctray.xml' curl -I 'http://localhost:8153/go/new_cctray.xml'
Member
Author
|
Some performance numbers are here. |
Contributor
|
Hi… just got here from the release notes for 15.1 and thought I’d mention that the URL mentioned in the first message is no longer correct—would it be worth editing it to indicate that the url is not |
Member
Author
|
Done. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a parallel implementation of cctray, available at
/go/new_cctray.xml (for now)/go/cctray.xml (after #1464 was merged). It reuses much of the existing code, but implements caching in a better way (as mentioned in the mail referenced in #795).Still need to verify the performance benefits of this. But, this can be accepted if someone has the time to review it, since it is implicitly feature toggled (since the URL is new).