Object2IntHashMap incorrectly increments it size on each merge call

For example:
var map = new Object2IntHashMap<String>(0);

map.merge("foo", 1, Integer::sum);
map.merge("foo", 1, Integer::sum);

assert map.size() == 1; // fails since the size == 2
map.values().forEach(System.out::println); // throws since it can't find second element

See https://github.com/real-logic/agrona/blob/f6c6d8be2cef3318d99ce31c347a3844d3c2acaa/agrona/src/main/java/org/agrona/collections/Object2IntHashMap.java#L483

The fix is also available in 1.23.1 patch release.

Cool, thank you!


TESTING DOCS-PREVIEW CI - DO NOT MERGE

Codecov Report

Merging #655 into master will decrease coverage by 24.58%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           master     #655       +/-   ##
===========================================
- Coverage   43.96%   19.38%   -24.59%
===========================================
  Files          71       13       -58
  Lines        4890      913     -3977
  Branches      848      156      -692
===========================================
- Hits         2150      177     -1973
+ Misses       2438      725     -1713
+ Partials      302       11      -291

Impacted Files
Coverage Δ

docs-markdown/src/helper/utility.ts

docs-markdown/src/helper/alerts.ts

...s-markdown/src/controllers/xref/xref-controller.ts

docs-markdown/src/helper/list-object-model.ts

docs-markdown/src/controllers/italic-controller.ts

docs-markdown/src/helper/rows-columns.ts

docs-markdown/src/helper/markdown-table.ts

...own/src/controllers/cleanup/removeEmptyMetadata.ts

docs-markdown/src/controllers/snippet/utilities.ts

docs-markdown/src/helper/format.ts

... and 72 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8ab86e6...82b6ff4. Read the comment docs.


some remarks

https://github.com/supabase/pg_net/blob/04dd22fb7cf267d55057deccdf70aed373dc7032/src/worker.c#L434-L436
No! idle_cb function is called in TopMemoryContext context, and it does not pfree palloc'ed like
https://github.com/supabase/pg_net/blob/04dd22fb7cf267d55057deccdf70aed373dc7032/src/worker.c#L452
https://github.com/supabase/pg_net/blob/04dd22fb7cf267d55057deccdf70aed373dc7032/src/worker.c#L486
https://github.com/supabase/pg_net/blob/04dd22fb7cf267d55057deccdf70aed373dc7032/src/worker.c#L490
etc

https://github.com/supabase/pg_net/blob/04dd22fb7cf267d55057deccdf70aed373dc7032/src/worker.c#L147
https://github.com/supabase/pg_net/blob/04dd22fb7cf267d55057deccdf70aed373dc7032/src/worker.c#L360
https://github.com/supabase/pg_net/blob/04dd22fb7cf267d55057deccdf70aed373dc7032/src/worker.c#L488
https://github.com/supabase/pg_net/blob/04dd22fb7cf267d55057deccdf70aed373dc7032/src/worker.c#L492
https://github.com/supabase/pg_net/blob/04dd22fb7cf267d55057deccdf70aed373dc7032/src/worker.c#L510
postgres has own palloc function, so You should not use malloc!

https://github.com/supabase/pg_net/blob/04dd22fb7cf267d55057deccdf70aed373dc7032/src/worker.c#L549
uv library is great! but postgres has own event loop and You should use it like in pg_task
https://github.com/RekGRpth/pg_task/blob/e6b882618e238f05e3a3260ebf43f392ffd8b2c9/work.c#L59-L67
https://github.com/RekGRpth/pg_task/blob/e6b882618e238f05e3a3260ebf43f392ffd8b2c9/work.c#L788

https://github.com/supabase/pg_net/blob/04dd22fb7cf267d55057deccdf70aed373dc7032/src/worker.c#L530
really?! You work under postgres superuser in postgres database?! not-superusers should have power rights to access net.* tables. And how access from another databases? dblink?

https://github.com/supabase/pg_net/blob/04dd22fb7cf267d55057deccdf70aed373dc7032/src/worker.c#L462-L464
how about using FOR UPDATE SKIP LOCKED?

pg_curl with pg_task do same as pg_net things and even much more!

It's been a while since I worked on this so my memory is a bit fuzzy.

idle_cb function is called in TopMemoryContext context, and it does not pfree palloc'ed

IIRC the start transaction dance automatically creates a transaction-local memory context, so the palloc'd memory should be freed properly.

postgres has own palloc function, so You should not use malloc!

I don't see why not - using palloc ties the lifetime of the allocated memory to whichever memory context is currently active. I could of course obviate the need for malloc by always switching to TopMemoryContext whenever I wanted to malloc, but using malloc directly makes it clear that it's memory we manage ourselves.
Keep in mind we have 3 systems working together: Postgres, libcurl, and libuv, and for the latter 2 using malloc is at least the well-trodden path.

uv library is great! but postgres has own event loop

The decision to use libuv was mainly because Postgres's event loop API is not well-documented. Also, using libcurl with libuv is a known use case with example code I can use.
We did end up using WaitLatch to listen for SIGTERM etc., but using it in an idle callback I don't see exactly how it "conflicts".

You work under postgres superuser in postgres database?! not-superusers should have power rights to access net.* tables. And how access from another databases?

This was a short-term solution. The Supabase hosted database only uses the postgres database, and the postgres role is not a superuser.

Postgres, libcurl, and libuv, and for the latter 2 using malloc

No, libcurl may use any alloc function, see
https://github.com/RekGRpth/pg_curl/blob/39b52873b7e1bccdad81f701f15a09f42b16c327/pg_curl.c#L44-L62
and
https://github.com/RekGRpth/pg_curl/blob/39b52873b7e1bccdad81f701f15a09f42b16c327/pg_curl.c#L68

IIRC the start transaction dance automatically creates a transaction-local memory context, so the palloc'd memory should be freed properly.

There is no transaction in background worker in idle_cb function!

We did end up using WaitLatch to listen for SIGTERM etc., but using it in an idle callback I don't see exactly how it "conflicts".

WaitLatch wait 1000 ms, and libuv loop does not work in that time.

There is no transaction in background worker in idle_cb function!

I'm not sure what you mean - I'm talking about:
    StartTransactionCommand();
    PushActiveSnapshot(GetTransactionSnapshot());
    SPI_connect();
    // ...
    SPI_finish();
    PopActiveSnapshot();
    CommitTransactionCommand();

WaitLatch wait 1000 ms, and libuv loop does not work in that time

It does mean that requests aren't submitted to curl immediately (~1s delay), but libuv does not busy wait/sleep for 1000ms on every loop - only when it's not handling any requests.

I'm not sure what you mean

instead https://github.com/supabase/pg_net/blob/04dd22fb7cf267d55057deccdf70aed373dc7032/src/worker.c#L486-L488 and https://github.com/supabase/pg_net/blob/04dd22fb7cf267d55057deccdf70aed373dc7032/src/worker.c#L498 You may do
MemoryContext oldMemoryContext = MemoryContextSwitchTo(TopMemoryContext);
char *method = TextDatumGetCString(SPI_getbinval(SPI_tuptable->vals[i], SPI_tuptable->tupdesc, 2, &isnull));
MemoryContextSwitchTo(oldMemoryContext);

and instead https://github.com/supabase/pg_net/blob/04dd22fb7cf267d55057deccdf70aed373dc7032/src/worker.c#L85 You may do
pfree(ctx->data->method);

to avoid using non-postgres alloc/free

Yes, that's exactly what I said above - I could always switch to the TopMemoryContext and use palloc anywhere I'd use malloc. But I don't see why I have to, and using malloc makes it clear I'm interacting with the libcurl/libuv side rather than the Postgres side.
Also the memory allocated by TextDatumGetCString etc. should be deallocated along with the transaction-local memory context (see my code snippet above).

Postgres's event loop API is not well-documented

I studied it by source and done loop with many sockets in pg_task.

But I don't see why I have to

because it is a postgres plugin/extension!

Also the memory allocated by TextDatumGetCString etc. should be deallocated along with the transaction-local memory context (see my code snippet above).

But main aim is do not deallocate and use it outside

pg_curl with pg_task do same as pg_net things and even much more!

In this case I don't think doing more is an advantage, we really want to nail the http use case first. Just noted a recent memory leak fix on pg_task, having a larger codebase(specially in C code) increases the risk of these happening. pg_net codebase is smaller and focused in contrast.

really?! You work under postgres superuser in postgres database?!

Note that there's a comment above:
https://github.com/supabase/pg_net/blob/04dd22fb7cf267d55057deccdf70aed373dc7032/src/worker.c#L529-L530
Adding a GUC for configuring that seems simple enough.

Adding a GUC for configuring that seems simple enough. Could you submit a PR and help us with that?

What if database does not exist? (in pg_task it is created in this case)


feat: check for auth only in case of --explain

Closes #256
📑 Description

check for auth only in case of --explain passed to the cmd

✅ Checks

[x] My pull request adheres to the code style of this project
[ ] My code requires changes to the documentation
[ ] I have updated the documentation as required
[ ] All the tests have passed

@AlexsJones

@AlexsJones can you please help merge the PR?

Cheers @hdm23061993 for the contribution


[Refactor] Assembler.TryGetReferencedElement - hack

@nathanatstariongroup I had to refactor the code below to make it work. This is a bit of a hack, can you clean this up?
https://github.com/STARIONGROUP/uml4net/blame/5b871f73ab4d483428cd69013a5c4f317568ab98/uml4net.xmireader/Cache/Assembler.cs#L127

@nathanatstariongroup can this be closed?

closed by #61


AMQP broker hardcoded to queuename "Celery"

AMQP broker hardcoded to queuename "Celery"
The broker works with "celery" named queue name. There doesn't seem to be an option to customise those while initialising the broker.

Also, there are Delay Methods to work with args or kwargs but not a combination. Can we extend that ?

Hi @sunny316 I will look into PR requests for named queue. I think we can simply make Queue and Exchang public.
As for the second question, I created a new issue to support new method signature to support both args and kwargs: https://github.com/gocelery/gocelery/issues/142
You are also welcome to create a pull request.

The queue name "celery" is still hardcoded in SendCeleryMessage, so while it's possible to create a broker with a custom queue name, Delay will still always send tasks to the "celery" queue: https://github.com/gocelery/gocelery/blob/825d89059344006c104412e628d456b3a111a6a5/amqp_broker.go#L115


Extend 'spo theme apply' to support out of the modern themes

First of all thanks to Paweł for developing the spo theme apply command.
As we know it supports applying the custom themes created. I was wondering if it is worth extending that command to support the out of the box themes as well? If yes, then I am happy to work on it based on one of my blogs.

Seems like a very nice addition indeed. Is there a way to retrieve the standard themes' colors dynamically instead of hard-coding them to avoid inconsistencies should they change in the future?

I'm not able to find an API which returns the standard themes' colours. The GetTenantThemingOptions endpoint returns all the custom themes. I will keep looking for other options. Any help is appreciated. Thank you.

If there is no API for it at this moment, then let's use hard-coded values for the time being and adjust in the future, if things change.

Ok @waldekmastykarz . I will start working on it. Would the command be something like spo theme apply --isOutOfTheBox --name Blue --webUrl https://contoso.sharepoint.com/sites/project-x

Let's use --sharePointTheme instead of --isOutOfTheBox to make it consistent with the UI.


Disable save button and change warning for too small vote_weight

closes #3058

New translations of upstream/main contains also the new strings of this PR. But please fix the remark (missing "to") which I've fixed locally for my translation work.


add One-Time Password (TOTP and HOTP) support

This PR adds support for generating One-Time Passwords (OTP) using HMAC.

[x] add Base32 encoding / decoding support.

Hey @tanner0101, you just merged a pull request, have a coin!
You now have 850 coins.

This is brilliant!! 👍


Delete FluentPVCBinding if it times out without becoming Ready condition

Which issue(s) this PR fixes:
Fixes #38
What this PR does / why we need it:
Why
If FluentPVCBinding cannot find the target pod within one hour, it remains in Unknown status as an unnecessary resource in Kubernetes cluster. Such unnecessary resources can potentially impact the cluster and operations adversely, so I will modify it to be deleted. I added a process to delete PVC for the same reason.
Changes

Adding PodMissing condition.
If FluentPVCBinding cannot find the Pod and the FluentPVCBinding does not become the Ready condition within one hour, instead of setting the it to Unknown status, it will be deleted.
When PVC controller detects that FluentPVCBinding has become PodMissing, the PVC will proceed with deletion. Subsequently, FluentPVCBinding controller confirms that the PVC has disappeared and proceeds to delete the FluentPVCBinding.

How test it:
I have prepared a branch with applied the fixes and the reproduction method, so please check it here.

https://github.com/R-HNF/fluent-pvc-operator/tree/test-fix-issue38

In addition, I have also made modifications to ensure compatibility with Apple Silicon (arm chip) in the branch. If you're curious about the changes for Apple Silicon, please try the reproduction method on an AMD-based PC.

@banatt @niqniqniqq @kei-gnu
Thank you for your review! I'll merge it!


Refactor/front end tests

Description
Imported new redux.js/toolkit for the CreateTestStore and refactored the test store to be up to date
Changed the admin dashboard tests to auth0 from Okta
Added a function that works to allow window.matchMedia to run.
Video Link
https://www.loom.com/share/0404bd1fe6074fa19c0b338d512145f8
Trello Link
https://trello.com/c/9ylNLlFT/374-fix-front-end-tests
Type of change
Please delete options that are not relevant.

[X] Bug fix (non-breaking change which fixes an issue)

Checklist:

[X] My code follows the style guidelines of this project
[X] I have performed a self-review of my own code
[X] I have removed unnecessary comments/console logs from my code
[X] My changes generate no new warnings
[X] I have checked my code and corrected any misspellings
[X] No duplicate code left within changed files
[X] Size of pull request kept to a minimum
[X] Pull request description clearly describes changes made & motivations for said changes

Fantastic work!


Some feedback on Siren

Play around with Siren (installed using Docker from the unstable branch 39bd11f and have some feedbacks:

Under Logs, when no validators are present in the validator client, it shows:

while the vc logs:
INFO No validators present                   msg: see `lighthouse account validator create --help` or the HTTP API documentation, service: notifier
The No validators present should be displayed after INFO in the UI. When there are validator(s), the UI displays the correct info.

On a side note, I just thought that it will be nice to have a scrolling bar for the logs.

The active validators shown under Validator Management seems to be the total validators, not active validators, as below (I have 2 active validators in my vc and 4 total validators)

When entering Siren, it asks for Authentication where users can set a password. This can be skipped. However, if skipped, during withdraw validator, it is mandatory to enter a password. The solution here is to either making entering password optional in withdrawal validator, or enforcing mandatory password setup at the startup.

Some minor formatting issues under Validator Management, info for a particular validator:

I tried to withdraw a validator but it says:

Was explained that siren displays the log data by the keys its receives via the sse log api. This data was not present during given log.

handled in https://github.com/sigp/siren/pull/197

it was explained that siren defaults to the api-token to validate sensitive actions when session auth is not set.

could not recreate, however will keep looking into

Siren received 405 when accessing the https://ethereum.github.io/keymanager-APIs/?urls.primaryName=dev#/Voluntary%20Exit/signVoluntaryExit api...loking into it now


Add features for notes and groups

Notes should be able to extend across more than two participants.
Note over A,B,C: This is a long note!

Also, it would be really useful to create graphical groups around arrows, similar to 'opt's in web sequence diagrams.
Group Handshake
A->B: Send PacketRequest
B->A: Send PacketResponse
EndGroup

Finally, for when web sequences grow too big, it would nice to have the ability to collapse these groups to save both vertical and horizontal space.
CollapsibleGroup ReadDB
A->B: Send SQLQuery
B->A: Send DataSet
EndGroup

ETOOMANYFEATUREREQUESTS

You can already place notes over multiple participants, for example:

A->B: 1
B->C: 2
Note over A,C: This will cover lines A, B and C.

However, if you didn't know the order of the participants, I could see how you may not know that B was in the middle of C. So I think it might be far to allow A,B,C and ensure it covers all of them.

Yes opts would be cool, and there is already a feature request for them #160

Sounds a reasonable idea, but right now the generated SVGs are not interactive, but could be. Sounds low priority right now.

I welcome patches if you feel up to adding any of these features.