Comments (7)
I would like to contribute code to this issue if we decide that it should be implemented @dossy .
from dbmate.
How do you feel about emitting the errors if and when --verbose is also specified?
Do we need it?
The wait
command expects an error. Encountering an error is a normal part of its operation - that is the whole point of the command, to attempt a connection, and if there is an error to catch it and retry. For all other database drivers today we handle and suppress the error details.
In this case, the mysql driver is taking matters into its own hands and spewing some console output about an error in addition to returning an error. I think that is bad behavior of the driver and we should suppress it (along with the error which we already suppress).
from dbmate.
So, the error is being logged by the go-sql-driver/mysql driver, not by dbmate
itself.
I suspect the issue is caused by how k8s implements cluster networking, specifically in the case where there's a Service that registers the port for the service but has no Pods available to forward that traffic to, yet. In this case, K8s is accepting the connection on its ingress, but then drops the connection as there's no Pod to forward it to, which the MySQL client treats as an unexpected EOF (end of file, or in this case, server-closed network connection) and the driver is implemented to log that occurrence.
We have no direct control over the MySQL driver's behavior itself, so the best we could do from the dbmate
end would be to expose the DB.WaitInterval
as a command-line argument, as it's currently defaulted to 1 second which could be quite noisy if it takes a few minutes for the Pod to become available.
I think adding --wait-interval
and $DBMATE_WAIT_INTERVAL
as ways of setting the interval could be a useful addition, but ultimately I suspect just ignoring the noisy logging from the go-sql-driver/mysql
driver is the path of least resistance ... 😄
@jessebye, what do you think?
from dbmate.
@dossy seems like a reasonable approach, given the context 👍
from dbmate.
I would like to contribute code to this issue if we decide that it should be implemented @dossy .
I think that as long as the implementation preserves the current behavior by default, I think a contribution implementing this configurability would be useful to those who need it.
While there don't appear to be too many people who have come forward look for or needing this functionality, it is certainly a quality-of-life improvement that some folks may appreciate.
from dbmate.
I think we should silence any errors from mysql driver while we are in the "wait" operation. If there are any real error messages people need to uncover for debugging, they can run any other dbmate command.
Adding --wait-interval
cli flag seems reasonable (it is already exposed to API users), but it's not going to prevent this spam going to the console. So let's fix that first.
from dbmate.
I think we should silence any errors from mysql driver while we are in the "wait" operation. If there are any real error messages people need to uncover for debugging, they can run any other dbmate command.
Adding
--wait-interval
cli flag seems reasonable (it is already exposed to API users), but it's not going to prevent this spam going to the console. So let's fix that first.
How do you feel about emitting the errors if and when --verbose
is also specified?
from dbmate.
Related Issues (20)
- Dbmate Unable to Create SchemaMigrations Table HOT 6
- Postgres Schemas with special characters have DBMate create migration tables then cannot find it again
- ClickHouse Cloud https connection doesn't work HOT 2
- Getting pq: syntax error at or near "transaction" when running migration with transaction:false HOT 7
- The migration lock is not released after terminating the migration HOT 2
- Comments (on columns) that include line breaks are never created. HOT 1
- dbmate requires each migration to define a down block with '-- migrate:down' when it defined HOT 5
- No Zookeeper configuration in server config
- Support all DSN variants for clickhouse DATABASE_URL HOT 8
- Wait for Postgres to be ready HOT 3
- $PGHOST & $PGPORT are not respected. HOT 2
- Add a section to the README documenting how environment variables are used by dbmate
- Table aliases don't work with ClickHouse HOT 2
- The latest release is missing all the binaries HOT 2
- Could not open extension control file "/share/extension/http.control" HOT 2
- Embedded FS on Windows HOT 2
- `make docker-all` timeout when run locally. HOT 1
- DBMate always delets my database anytime I run a migration HOT 1
- Library methods not using context
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dbmate.