-
Notifications
You must be signed in to change notification settings - Fork 1
Rabbitmq refactor unmerged #20
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
Conversation
Signed-off-by: Benedict Wong <bennydictwong@gmail.com>
Signed-off-by: Benedict Wong <bennydictwong@gmail.com>
Signed-off-by: Benedict Wong <bennydictwong@gmail.com>
…ckage to prevent circular dependencies Signed-off-by: Benedict Wong <bennydictwong@gmail.com>
…ndling Signed-off-by: Benedict Wong <bennydictwong@gmail.com>
modules/datahandling/dhmessages.go
Outdated
| //const servfail int = 500 | ||
| //const unimplemented = 501 | ||
| //const servpartialfail int = 599 | ||
|
|
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.
there's not really a reason to keep all of these comments around, is there?
|
|
||
| // If no tag, do not send a response | ||
| // This is used in cases where we auto-register a client (ie, for username) | ||
| if cmd.Tag < 0 || r.WSConn == nil { |
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.
clever
modules/rabbitmq/rabbitmanager.go
Outdated
| /** | ||
| * RabbitMq manager for CodeCollaborate Server. | ||
| */ | ||
| //*/ |
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.
get rid of this commenting out of the comment end
| // panic so we shut down the subscriber too | ||
| panic(err) // TODO(shapiro): Think of a better way of having publisher and consumer be able to shut each other down | ||
| // Shut down subscriber if failed here. | ||
| return fmt.Errorf("RunPublisher: Failed to get new channel: %v", err) |
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.
do you not want to log this error?
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.
Nah. this gets logged at a higher level. We probably don't want to pollute the logs by logging twice.
| "checksumSHA1": "2ejItuuU32nvGsyKMvguQ2tUdMo=", | ||
| "path": "github.com/stretchr/testify", | ||
| "revision": "d77da356e56a7428ad25149ca77381849a6a5232", | ||
| "revisionTime": "2016-06-15T09:26:46Z", |
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.
don't commit just hash changes for vendor.json
do git checkout origin/test vendor/vendor.json to reset it
| // pc[2] = caller of LogWithFunc | ||
| pc := make([]uintptr, 1) | ||
| runtime.Callers(2, pc) | ||
| runtime.Callers(3, pc) |
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 the change here?
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.
Added comments to clarify
Signed-off-by: Benedict Wong <bennydictwong@gmail.com>
|
I'm going to go ahead and accept this, but note that we still have an issue with the TestSubscription test. It will fail and produce some goroutine traces every once in awhile, but it has been doing so since before these changes. We're just kicking the can down the road for a bit. |
* Merge pull request from CodeCollaborate/ServerWSManager to test Server ws management feature merged into test * Added new RunFormatter script (#3) * Added new RunFormatter script that prints any golint/govet errors, and auto-formats the source code Signed-off-by: Benedict Wong <bennydictwong@gmail.com> * Updated the Git hook to use RunFormatter instead of CheckFormatting Signed-off-by: Benedict Wong <bennydictwong@gmail.com> PR signed-off by Joel Shapiro * Signed off by @ObsessiveOrange * add parsing of top level JSON, begin work on dynamic parsing of request specific data * Finished factory methods for request lookup and creation. Have a single unit test. * Finalized design layout, reorganized abstract map constructor function placement to respective resource files, added tests * add separate function-space for unauthenticated request type and build appropriate framework around it * added the remaining user methods to the maps * Fixed some method signature issues. * fix minor naming issues and add missing todos * reduce unnecessary exporting * rename authenticated map * add new Request interface requrements to eliminate duplicate code * changed to new format for entering into the authentication map * Implemented new key format and new interface method for requests * fixed problems I forgot to fix before pushing * fixed reference issue * Made several optimizations through addition of several parameters as pointers. * add major tests to function map * fixed formatting issues Signed off by @ObsessiveOrange * added tests for invalid JSON (#5) Signed off by Benedict Wong * Update RabbitMQ tests (#7) * Updated RabbitMQ Tests, will error on failed RabbitMQ Conn Signed-off-by: Benedict Wong <bennydictwong@gmail.com> * Removed setup for better test clarity Signed-off-by: Benedict Wong <bennydictwong@gmail.com> PR signed off by: Joel Shapiro <joel.shapiro7@gmail.com> * DB/FS (#9) * added functions for relevant interactions with couchbase * mysql work * Updated Travis config for Couchbase setup * Disabled couchbase install for now * Couchbase (#8) * Test * Added bucket creation * Reduced sleep time * Reduced sleep time * Changed download file name Signed off by Joel Shapiro (jshap70) * fixed ben's dumb file endings * add all mysql functions and unify errors, lots of work * changed msyql config * added MySQL setup script, adding more errors for file storage prep added file system implementations still TODO: lookup file info by FileID, delete file This is a combination of 15 commits. tyring to fix mysql not being setup in travis * setting up mysql schema for travis * added lookup file metadata function to mysql, travis attempts fix linting issue update mysql schema * fix .gitignore issue * added schema switching based on config, fixed lots of issues w/ readability as well as file path joining Signed off by @ObsessiveOrange * fixed travis image in readme (#10) LGTM * Turn on travis caching, enable slack notifications in travis (#12) * turn on travis caching, enable slack notifications in travis * upgrade go to 1.7 * fix caching issue where we cached our own old code base (#13) * Intgoprocdandeling - aka: server function processing (#11) Implemented process functions & data handling. Server is now functionally ready to develop against. LGTM - ObsessiveOrange * Patching (#14) Ported OT logic to server, updated tests to be the same as clientcore * Authentication (#15) Added authentication and tests, added token validity timeout to server config file * add changes to RunTest.sh to allow for error printing to console (#16) * Logging (#17) New logger, logs to console and ./data/logs/ by default, changed docker setup script to use Go for extensibility. * change type assertion to type conversion, *mumble mumble* golang types are weird (#18) * Rabbitmq refactor unmerged (#20) Refactored RabbitMQ to allow for commands to be sent, refactored responses/notifications into separate package to prevent circular dependencies. * Resolve panic issue for subscribers and publishers killing each other Changed all control.Exit close commands to use Shutdown * api permissions (#19) * update mysql to add permission value map * reset changes to mysql, rename files * add permissions to config, add mysql sproc for permission lookup by project * implement go to mysql storedproc implementation, fix user permission stored proc to work for owner, fix erronious int8-int32 casting * reformat to follow go conventions * fix sproc definer hostname bug which was causing travis errors * setup framework for permissions probing * implement permission checking in required process functions * implement projectGetPermissionConstants * fix request plurality * add catch to reject adding an ownership permission * rebase cleanup * allow users to remove themselves * make error code more clear that changing owner is ready * fix foreign key on user deletion * add error catching if a user tries to revoke the permission of the owner * User.Delete request (#22) * first implementation of User.Delete * add project.delete notifications for all projects that are deleted with a user * requested changes for pr * hotfix to fix issues with mysql connection (#23) * resolve nil pointer reference panic on mysql error * change mysql permissions to execute only by default * add retries to mysql * add error on file.create error * change couchbase to ignore previously written files for now * add retry timeout * track todo * fix off by one error * Rabbitmq panic hotfix (#24) fix panic errors for sending on closed channel * fix runtests, revert couchbase to use insert * project revoke permission hotfix(es) (#26) * implement sending a notification to the user who's permissions are getting revoked * unsubscribe a user when their project permissions are revoked * run the server on travis build * Changed User.Projects to return full map of project objects (#27) * make delete require authentication * add password generation abilities outside of the user regiser request * reorganize * update command flag * Notification dedup (#31) Notifications will no longer be sent to the client that sent the originating request * Scrunching (#30) Added scrunching to backend. Will scrunch all but top N changes (currently a local variable) Dependent on CodeCollaborate/ClientCore#24 - Patch Batching * ensure unique filepaths per project (#32) implement duplicate projectID + file path + filename checking in mysql * travis yaml fixes for mysql version changes (#34) * update couchbase driver version (#36) * Script cleanup (#37) * rename and move scripts * cleanup formatter's formatting * make run_tests run parallel * fix formatter to only run commands once * cleanup prints * update commit hook * Add SSL to server (#35) * Added TLS if /config/TLS directory found Signed-off-by: Benedict Wong <bennydictwong@gmail.com> * Added update script Signed-off-by: Benedict Wong <bennydictwong@gmail.com> * Updated permissions Signed-off-by: Benedict Wong <bennydictwong@gmail.com> * Updated server script Signed-off-by: Benedict Wong <bennydictwong@gmail.com> * Removed git pulling Signed-off-by: Benedict Wong <bennydictwong@gmail.com> * Added init.d script, updated server script Signed-off-by: Benedict Wong <bennydictwong@gmail.com> * Updated permissions Signed-off-by: Benedict Wong <bennydictwong@gmail.com> * Updated init.d installer script Signed-off-by: Benedict Wong <bennydictwong@gmail.com> * Updated init.d installer script Signed-off-by: Benedict Wong <bennydictwong@gmail.com>
Refactored RabbitMQ to allow for commands to be sent, refactored responses/notifications into separate package to prevent circular dependencies.
Refactored RabbitMQ to allow for subscription commands to be sent via RabbitMQ