Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
* Fixed the stream handling Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Updated the khazana version Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Fix the logger Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * changed the khazana version Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * removed the logger Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Removed unused code Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Removed whitespace Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> --------- Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com>
…tting the packet (mosip#283) Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com>
* MOSIP-44507 (mosip#282) * Fixed the stream handling Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Updated the khazana version Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Fix the logger Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * changed the khazana version Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * removed the logger Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Removed unused code Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Removed whitespace Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> --------- Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * removed the thread synchornization and removed dupplicate call for getting the packet Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * MOSIP-44507 Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Fixed the schema validation Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Fix the /biometric endpoint issue taking longer time to respond Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Fix the cache issue Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Fix the cache issue Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Fix the cache issue Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Added cache Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Added cache Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * removed cache Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * removed cache changes Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Fixed the loggers Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Added logger in decrypt method Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * modified ziputils Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * packetreaderservice Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Fixed securitycontext issue Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Reverted packetreader service Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Fix the /info endpoint Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Fixed /info endpoint slowness issue Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Fix the /info endpoint Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Fixed packetreaderservice slowness issue Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Fixed packetreaderservice slowness issue Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Reverted packetreaderservice Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Reverted packetreaderimpl changes Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Fix the /info endpoint slowness issue Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Fix the packetreaderimpl Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * increased the performance of /info endpoint Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * increased the performance of /info endpoint Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * increased the performance of /info endpoint Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * reverted packetreader service impl changes Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Added back packet reader impl changes Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Made audit to async Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * reverted packet reader service Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Added virtual thread to improve the performance Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Fixed the Audit log entry Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Fixed packet reader service info call performancee Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Fixed packet reader service info call performancee Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Fixed test case Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Fixed the executor to pass securitycontext Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Fixed pod failing issue Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Reverted the config Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Fixed the performance issue Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Fixed performance issue Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Fixed the executor issue Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Fix the stability issue Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Fix the search filed repeated s3 calls Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * updated khazana version Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Reverted the khazana version Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Fix the validate request endpoint Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Fixed the validate endpoint performance Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Fixed the object serialization issue Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Updated khazana version Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * reverted khazana version Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * removed the loggers Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> * Fixed the build failure and removed the logger Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> --------- Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com> Signed-off-by: Dhanendra Sahu <60607841+dhanendra06@users.noreply.github.com> Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com>
…#285) Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com>
…#287) Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com>
Signed-off-by: Dhanendra Sahu <dhanendra.tech@gmail.com>
Signed-off-by: Ashok Kumar Sharma <ashok@mosip.io>
| @Bean(name = "auditTaskExecutor") | ||
| public ExecutorService auditTaskExecutor() { | ||
| auditPool = Executors.newFixedThreadPool(auditPoolSize, | ||
| Thread.ofPlatform().name("audit-", 0).daemon(true).factory()); |
There was a problem hiding this comment.
We should not use the daemon threads because these threads get killed once the main thread is completed and JVM will not wait to finish these threads.
| @Bean(name = "packetFetchExecutor") | ||
| public ExecutorService packetFetchExecutor() { | ||
| fetchPool = Executors.newFixedThreadPool(fetchPoolSize, | ||
| Thread.ofPlatform().name("pkt-fetch-", 0).daemon(true).factory()); |
There was a problem hiding this comment.
We should not use the daemon threads because these threads get killed once the main thread is completed and JVM will not wait to finish these threads.
| @Value("${packetmanager.fetch.concurrency.limit:35}") | ||
| private int fetchConcurrencyLimit; | ||
|
|
||
| private Semaphore fetchSemaphore; |
There was a problem hiding this comment.
We need to check on this because it can restrict the overall packet processing underload because we are using the same semaphore multiple places.
|
|
||
| BIR cachedValue = cache.get(cacheKey, BIR.class); | ||
| if(cachedValue != null) { | ||
| byte[] cachedBytes = cache.get(cacheKey, byte[].class); |
There was a problem hiding this comment.
Why we have changed the caching logic. Previously we were caching the BIR not byte[] is being cached. We have two issues with this:
- It can break the existing caching in redis because now cache data got changed.
- We need to call CbeffValidator.getBIRFromXML(cachedBytes); during the cache hit which is unnecessary during the hot path.
| // biometric file not present in idobject. Search in meta data. | ||
| Map<String, String> metadataMap = getMetaInfo(id, source, process); | ||
| // Use facade's cached getMetaInfo() to avoid redundant S3 calls under high load. | ||
| Map<String, String> metadataMap = packetReader.getMetaInfo(id, source, process, false); |
There was a problem hiding this comment.
I feel this change is not required because in positive flow, we find the bioString and we may not get into this flow. Issue is:
- While using this method, we are using the cached data which can cause issue.
There was a problem hiding this comment.
- Same semaphore is used for concurrency control which may block the threads in peak load.
| // Faster than regex | ||
| if (str.length() >= 2 && str.charAt(0) == '"' && | ||
| str.charAt(str.length() - 1) == '"') { | ||
| str = str.substring(1, str.length() - 1); | ||
| } |
There was a problem hiding this comment.
Please check this code is not equivalent to finalMap.putIfAbsent(key, value.toString().replaceAll("(^")|("$)", "")); Please check.
| Map<String, Object> objectMap = new HashMap<>(); | ||
| for (String field : allFields) { | ||
| Object value = identityFields.get(field); | ||
| if (value == null) continue; | ||
| if (value instanceof String || value instanceof Number || value instanceof Boolean) { | ||
| objectMap.put(field, value); | ||
| } else { | ||
| objectMap.put(field, mapper.writeValueAsString(value)); | ||
| } |
There was a problem hiding this comment.
In previous code, we were doing the conversion as dataType which is missing here : https://github.com/mosip/packet-manager/blob/v1.3.0/commons-packet/commons-packet-manager/src/main/java/io/mosip/commons/packet/impl/PacketReaderImpl.java#L142-L155
| // Fetch info once for source resolution; reuse across all fields | ||
| // to avoid N redundant S3 listObjectsV2 calls (one per field). | ||
| InfoResponseDto cachedInfo = packetReaderService.getInfoForSourceResolution(fieldDtos.getId()); |
There was a problem hiding this comment.
Do we need this change because getSourceAndProcess() already calling packetReaderService.getInfoForSourceResolution(id); internally?
|
As packet manager is being used as library. We need to validate whether packet manager library in reg client is also working fine as we have done lot of changes. |
No description provided.