Skip to content
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

Wrong order of arguments to sprintf in reporting connection failures #95

Closed
kevinushey opened this issue Jan 4, 2023 · 4 comments
Closed
Labels
bug Something isn't working
Milestone

Comments

@kevinushey
Copy link

Here:

stop(sprintf(ngettext(failed,
"Cluster setup failed (connectTimeout=%.1f seconds). %d worker of %d failed to connect.",
"Cluster setup failed (connectTimeout=%.1f seconds). %d of %d workers failed to connect."),
failed, connectTimeout + 5, length(cl)))

I believe connectTimeout + 5 should be coming first.

@HenrikBengtsson HenrikBengtsson added the bug Something isn't working label Jan 4, 2023
@HenrikBengtsson HenrikBengtsson added this to the Next release milestone Jan 4, 2023
HenrikBengtsson added a commit that referenced this issue Jan 4, 2023
…essage, or an error on incorrect printf arguments [#95]
@HenrikBengtsson
Copy link
Owner

Thank you. Two reproducible examples with different outcomes:

> cl <- parallelly::makeClusterPSOCK(2L, rscript_startup = quote(Sys.sleep(6.0)), connectTimeout = 0.0)
Error in parallelly::makeClusterPSOCK(2L, rscript_startup = quote(Sys.sleep(6)),  : 
  Cluster setup failed (connectTimeout=2.0 seconds). 5 of 2 workers failed to connect.

and

> cl <- parallelly::makeClusterPSOCK(2L, rscript_startup = quote(Sys.sleep(6.0)), connectTimeout = 0.1)
Error in sprintf(ngettext(failed, "Cluster setup failed (connectTimeout=%.1f seconds). %d worker of %d failed to connect.",  : 
  invalid format '%d'; use format %f, %e, %g or %a for numeric objects

Fixed in commit 0e94e25.

@kevinushey
Copy link
Author

Thank you for taking a look so quickly!

@HenrikBengtsson
Copy link
Owner

Fixed version now on CRAN

@kevinushey
Copy link
Author

kevinushey commented Jan 30, 2023

Thanks again for taking a look so quickly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants