Skip to content

Conversation

@csegarragonz
Copy link
Collaborator

No description provided.

@csegarragonz csegarragonz self-assigned this Oct 20, 2021
}

#define CHECK_ERRORS(response) \
#define CHECK_ERRORS(response, bucketName, keyName) \
Copy link
Collaborator Author

@csegarragonz csegarragonz Oct 20, 2021

Choose a reason for hiding this comment

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

I also update this macro as otherwise the error messages would be of very little help.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree, these errors are usually pretty hard to parse. I'm not sure the no key and no bucket messages are paricularly clear in the current form though. Instead we could have a conditional and log the error without a key or bucket if there isn't one, e.g.

#define CHECK_ERRORS(response, bucketName, keyName)         
{
        if (!response.IsSuccess()) {
            const auto& err = response.GetError();
            if(bucketName.empty()) {
                SPDLOG_ERROR("General S3 error");
            else if(keyName.empty()) {
                SPDLOG_ERROR("S3 error for bucket: {}", bucketName);
            } else {
                SPDLOG_ERROR("S3 error with bucket/key: {}/{}", bucketName, keyName);
            }
            ...
        }
    }
    
...
CHECK_ERRORS(response, "", "");
CHECK_ERRORS(response, bucketName, "");
CHECK_ERRORS(response, bucketName, keyName);

@csegarragonz csegarragonz force-pushed the codegen-fix branch 2 times, most recently from 42a86a9 to 664cf8e Compare October 20, 2021 16:48
if (conf.wasmVm == "wamr") {
(void)loader.loadFunctionWamrAotHash(msg);
} else {
(void)loader.loadFunctionObjectFile(msg);
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's this void cast for? If it's to deal with warnings, we have an UNUSED macro.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point. That being said, the UNUSED macro gives a compiler warning itself because it clashes with an UNUSED definition in pistache 🤣

I suggest we eventually change it to FAABRIC_UNUSED.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Haha yes, clearly great minds think alike (or both read the same SO post...)

}

#define CHECK_ERRORS(response) \
#define CHECK_ERRORS(response, bucketName, keyName) \
Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree, these errors are usually pretty hard to parse. I'm not sure the no key and no bucket messages are paricularly clear in the current form though. Instead we could have a conditional and log the error without a key or bucket if there isn't one, e.g.

#define CHECK_ERRORS(response, bucketName, keyName)         
{
        if (!response.IsSuccess()) {
            const auto& err = response.GetError();
            if(bucketName.empty()) {
                SPDLOG_ERROR("General S3 error");
            else if(keyName.empty()) {
                SPDLOG_ERROR("S3 error for bucket: {}", bucketName);
            } else {
                SPDLOG_ERROR("S3 error with bucket/key: {}/{}", bucketName, keyName);
            }
            ...
        }
    }
    
...
CHECK_ERRORS(response, "", "");
CHECK_ERRORS(response, bucketName, "");
CHECK_ERRORS(response, bucketName, keyName);

Copy link
Collaborator

@Shillaker Shillaker left a comment

Choose a reason for hiding this comment

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

Nice, just the one UNUSED.

if ((!oldHash.empty()) && newHash == oldHash) {
// Even if we skip the code generation step, we want to sync the latest
// shared object object file
(void)loader.loadSharedObjectObjectFile(inputPath);
Copy link
Collaborator

Choose a reason for hiding this comment

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

One more UNUSED

@csegarragonz csegarragonz merged commit 6151282 into master Oct 22, 2021
@csegarragonz csegarragonz deleted the codegen-fix branch October 22, 2021 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants