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

HPCC-11522 libmemcached plugin #6691

Conversation

jamienoss
Copy link
Collaborator

Previously: #6368 & #6686

Signed-off-by: jamienoss james.noss@lexisnexis.com

@hpcc-jirabot
Copy link

https://track.hpccsystems.com/browse/HPCC-11522
Jira not updated (state was not active or new)

@jamienoss
Copy link
Collaborator Author

@ghalliday re-targeted.

@jamienoss jamienoss force-pushed the issue11522-support-memcached-b4-pool-removed branch 3 times, most recently from 3c1ce38 to 68277af Compare November 25, 2014 23:49
@@ -81,11 +81,12 @@ IF ("${COMMONSETUP_DONE}" STREQUAL "")
option(USE_PYTHON "Enable Python support" ON)
option(USE_V8 "Enable V8 JavaScript support" ON)
option(USE_JNI "Enable Java JNI support" ON)
option(USE_RINSIDE "Enable R support" ON)
option(USE_RINSIDE "Enable R support support" ON)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

support support??

@jamienoss jamienoss force-pushed the issue11522-support-memcached-b4-pool-removed branch from 68277af to 21e84ca Compare November 26, 2014 10:42
msg.append(key).append("' is of type ").append(enumToStr((eclDataType)(flag))).append(", not ").append(enumToStr(eclType)).append(" as requested.\n");

if (++typeMismatchCount <= MAX_TYPEMISMATCHCOUNT)
ctx->addWuException(msg.str(), WRN_FROM_PLUGIN, ExceptionSeverityInformation, "");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not convinced by this. I imagined it would report a warning N times, and then not report any more. This will keep reporting warnings/errors but will still continue executing. I think the else branch just needs to go.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't ExceptionSeverityError terminate exec? This aside, I'll remove that branch.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no. It just adds it into a different category

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there one that does then?

@ghalliday
Copy link
Member

@jamienoss getting closer.

@jamienoss
Copy link
Collaborator Author

@ghalliday like standing at conformal infinity and watching someone pass an event horizon!

@jamienoss jamienoss force-pushed the issue11522-support-memcached-b4-pool-removed branch from fece0a7 to a5f4765 Compare November 26, 2014 17:51
@jamienoss
Copy link
Collaborator Author

@ghalliday back to you.

CriticalBlock block(crit);
if (!cachedConnection)
{
cachedConnection.set(new MemCachedPlugin::MCached(ctx, servers));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be .setown, same for the call below. It will leak as it stands.

@ghalliday
Copy link
Member

@jamienoss still some problems.

@jamienoss
Copy link
Collaborator Author

@ghalliday any better?


if (sizeof(type)!=returnLength)
{
VStringBuffer msg("MemCachedPlugin: ERROR - Requested type (%luB) of different size from that stored (%luB). Check logs for more information.", sizeof(type), returnLength);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately has a couple of problems:

  • You can't assume sizeof is 64bit/fixed size. So whenever you pass sizeof/size_t to printf you need to cast it to a fixed size type. (It does affect the stack layout and will give you wrong values on some machines). In this case I would cast to unsigned since they're small.
  • %lu is used for a long integer. This is different from a 64 bit integer. Because the format specifiers for 64bit differ between windows and linux you would need to say.

...(%"I64F"u...

if the argument is 64bit.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

picky: the size should come after "size" rather than "type"

@ghalliday
Copy link
Member

@jamienoss close but...

@jamienoss
Copy link
Collaborator Author

@richardkchapman Cheers for the intel. VStringBuffer is much neater.

Previously: hpcc-systems#6368 & hpcc-systems#6686

Signed-off-by: jamienoss <james.noss@lexisnexis.com>
Signed-off-by: jamienoss <james.noss@lexisnexis.com>
Signed-off-by: jamienoss <james.noss@lexisnexis.com>
@jamienoss jamienoss force-pushed the issue11522-support-memcached-b4-pool-removed branch from 9beb378 to f482eef Compare November 28, 2014 17:21
@jamienoss
Copy link
Collaborator Author

@ghalliday ?

@ghalliday
Copy link
Member

{Miracle occurs}

ghalliday added a commit that referenced this pull request Dec 1, 2014
…b4-pool-removed

HPCC-11522 libmemcached plugin

Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>
@ghalliday ghalliday merged commit d6052cf into hpcc-systems:candidate-5.2.0 Dec 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants