-
Notifications
You must be signed in to change notification settings - Fork 366
snapshots: add https #6354
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
snapshots: add https #6354
Conversation
af17034 to
29a54f9
Compare
a0bd347 to
3488f1f
Compare
| http_connect_ssl( fd_sshttp_t * http, | ||
| long now ) { | ||
| if( FD_UNLIKELY( now>http->deadline ) ) { | ||
| FD_LOG_WARNING(("deadline exceeded during connect")); |
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.
| FD_LOG_WARNING(("deadline exceeded during connect")); | |
| FD_LOG_WARNING(( "deadline while connecting to HTTPS snapshot server" )); |
Might also want to log the peer URL here
| if( FD_UNLIKELY( ssl_err!=1 ) ) { | ||
| int ssl_err_code = SSL_get_error( http->ssl, ssl_err ); | ||
| if( FD_UNLIKELY( ssl_err_code!=SSL_ERROR_WANT_READ && ssl_err_code!=SSL_ERROR_WANT_WRITE ) ) { | ||
| FD_LOG_WARNING(( "SSL_connect failed (%d)", ssl_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.
These WARNING logs should ideally be operator friendly.
e.g. error while downloading snapshot from https://: SSL_connect failed (%i-%s)
| if( FD_LIKELY( res<=0 ) ) { | ||
| int ssl_err_code = SSL_get_error( http->ssl, res ); | ||
| if( FD_UNLIKELY( ssl_err_code!=SSL_ERROR_WANT_READ && ssl_err_code!=SSL_ERROR_WANT_WRITE && res!=0 ) ) { | ||
| FD_LOG_WARNING(( "SSL_shutdown failed (%d)", ssl_err_code )); |
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.
same here, warning log shoudl be operator friendly
| int ssl_err = SSL_get_error( http->ssl, read_res ); | ||
|
|
||
| if( FD_UNLIKELY( ssl_err!=SSL_ERROR_WANT_READ && ssl_err!=SSL_ERROR_WANT_WRITE ) ) { | ||
| FD_LOG_WARNING(( "SSL_read failed (%d)", ssl_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.
operator friendly warning log
| int ssl_err = SSL_get_error( http->ssl, write_res ); | ||
|
|
||
| if( FD_UNLIKELY( ssl_err!=SSL_ERROR_WANT_READ && ssl_err!=SSL_ERROR_WANT_WRITE ) ) { | ||
| FD_LOG_WARNING(( "SSL_write failed (%d)", ssl_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.
operator friendly warning log
| long sent = sendto( http->sockfd, buf, bufsz, 0, NULL, 0 ); | ||
| if( FD_UNLIKELY( -1==sent && errno==EAGAIN ) ) return FD_SSHTTP_ADVANCE_AGAIN; | ||
| else if( FD_UNLIKELY( -1==sent ) ) { | ||
| FD_LOG_WARNING(( "sendto() failed (%d-%s)", errno, fd_io_strerror( errno ) )); |
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.
operator friendly warning log
src/discof/restore/utils/fd_sshttp.c
Outdated
| .fd = http->sockfd, | ||
| .events = POLLIN, | ||
| }; | ||
| fd_syscall_poll( &pfd, 1 /*fds*/, 1 /*ms*/ ); |
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.
check error code of syscall (FD_LOG_ERR if poll returns a weird errno)
| int ssl_err = SSL_get_error( ssresolve->ssl, write_res ); | ||
|
|
||
| if( FD_UNLIKELY( ssl_err!=SSL_ERROR_WANT_READ && ssl_err!=SSL_ERROR_WANT_WRITE ) ) { | ||
| FD_LOG_WARNING(( "SSL_write failed (%d)", ssl_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.
operator friendly error log
|
|
||
| read = (long)read_res; | ||
| #else | ||
| FD_LOG_ERR(( "cannot use HTTPS without OpenSSL" )); |
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.
this build of Firedancer does not support OpenSSL, rebuild with deps.sh
or something along those lines, otherwise operator is going to be confused why OpenSSL was not fonud
| if( FD_UNLIKELY( ssl_err!=1 ) ) { | ||
| int ssl_err_code = SSL_get_error( ssresolve->ssl, ssl_err ); | ||
| if( FD_UNLIKELY( ssl_err_code!=SSL_ERROR_WANT_READ && ssl_err_code!=SSL_ERROR_WANT_WRITE ) ) { | ||
| FD_LOG_WARNING(( "SSL_connect failed (%d)", ssl_err_code )); |
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.
operator friendly error log
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.
I'll address log-related comments in a follow up
169f412
92a9bbd to
169f412
Compare
Performance Measurements ⏳
|
169f412 to
d42f65d
Compare
Performance Measurements ⏳
|
Fixes incorrect usage of the OpenSSL 'static' feature which is intended for statically linking glibc. The static feature breaks multi-threaded use of OpenSSL, so it should be disabled. Note that libssl.a still gets built, so OpenSSL itself is still statically linked.
Performance Measurements ⏳
|
| FD_MCNT_SET( TOWER, HARD_FORKS_PRUNED, ctx->metrics.hard_forks.pruned ); | ||
|
|
||
| FD_MGAUGE_SET( TOWER, HARD_FORKS_ACTIVE, ctx->metrics.hard_forks.active ); | ||
| FD_MGAUGE_SET( TOWER, HARD_FORKS_MAX_WIDTH, ctx->metrics.hard_forks.max_width ); |
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.
was this intended?
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.
yes, charlie forgot to remove this line after he removed the metric in metrics.xml
No description provided.