-
Notifications
You must be signed in to change notification settings - Fork 14
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
fix: enhancements to config parsing and dao #28
Conversation
@darahayes I couldn't verify according to the steps provided. I'm getting error when running the docker-compose command:
|
My bad @psturc you must run |
I'm not sure what I'm doing wrong - |
@psturc This is strange. It seems to me by the error message that you do not have the latest code. It's building on my machine and in CircleCI. Can you try pull this branch again and ensure you have the latest changes? the most recent commit has the message |
@darahayes yep, confirming I have the latest changes:
This will be probably some stupid think I'm overlooking. btw I'm using
|
Pull Request Test Coverage Report for Build #7
💛 - Coveralls |
@psturc I've merged master back into this branch can you try pulling again? If that doesn't work can you try deleting and fetching the branch again? Or perhaps cloning the repo again? I'm out of ideas beyond this 😅 |
@darahayes code lgtm, the clientId validation is fine, I think limit for 128 chars should be sufficient. However I cannot verify this locally, I tried everything you've suggested above, but the build is still failing with the same error. Could anybody else please try that too? |
@psturc I think I figured out your issue: in the logs you sent me I saw the path Please ensure you have the latest code cloned to the directory We changed the name of the service recently |
@darahayes lol of course, nice catch Dara :) I will verify it locally soon then |
@@ -28,11 +32,19 @@ type DeviceMetric struct { | |||
PlatformVersion string `json:"platformVersion"` | |||
} | |||
|
|||
const clientIdMaxLength = 128 | |||
|
|||
var clientIdLengthError = fmt.Sprintf("clientId exceeded maximum length of %v", clientIdMaxLength) |
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.
@darahayes I'm missing context but is the clientId not a fixed length across the SDKs? Since you've pinged @psturc on the PR description probably you two are aware of why this is needed.
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.
@paolobueno I have no idea what the clientId length is coming from Android/iOS. I just chose 128 as a sane default. If I can get more specific info that would be great!
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.
it's 36 on iOS side
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.
On the android sdk it's a UUID: https://github.com/aerogear/aerogear-android-sdk/blob/master/core/src/main/java/org/aerogear/mobile/core/utils/ClientIdGenerator.java#L39 so also 36.
@darahayes I just noticed one thing, unfortunately unrelated to this PR. There's a difference between API and client side in one property ( I think |
@psturc Great catch. Let's update the server and the original proposal. |
@psturc I've updated the |
Ok, verified that |
@psturc Did you manage to verify the other steps? |
@darahayes yes, sorry I forgot to mention that it was all verified with |
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.
Verified locally using verification instructions 👍
* fix: use varchar(128) for clientId * fix: basic connection retry logic * fix(config): major improvements to config parser * fix(dao) use new config and set max db connections * fix: enforce clientId max length at app layer * fix: rename data.app.id label to data.app.appId
This PR introduces a number of enhancements:
db.SetMaxOpenConns()
with a default of 100 which is apparently the default allowed by Postgres. See docs.Verification
Delete all containers previously run by docker-compose. You can get the container IDs with the following
docker ps -a | grep aerogearappmetrics
Then run
docker rm <id>
for each id.Then forcefully recreate your docker-compose environment with the following:
You should notice 2 things:
The metrics server did not crash while trying to connect to the database.
Make the following curl request:
And you should see the following message: